Payment Gateway (Stripe/PayTabs/HyperPay) → SAP B1 IncomingPayments

Gateway → SAP B1. payment_intent.succeeded webhook → find the open invoice via DocEntry stored in gateway metadata → POST /IncomingPayments with a PaymentInvoices array linking DocEntry + SumApplied. Fees are booked separately: pay gross to a gateway clearing account, expense the fee. Payout reports become journal entries moving clearing → bank. Refunds → CreditNotes + outgoing payment.

Steps in this flow

  1. Gateway: payment_intent.succeeded
  2. Verify Webhook Signature (HMAC)
  3. Guard: Payment Intent ID
  4. SL Login (B1SESSION)
  5. SL: GET Invoice by DocEntry (metadata)
  6. Refund Event?
  7. SL: POST /IncomingPayments (gross→clearing)
  8. SL: POST /CreditNotes (refund)
  9. Log Payment Result

All templates