Outdated Endpoint
This endpoint is not relevant to Forage versions
2024-03-05and later.With
2024-03-05, Forage createsOrderPaymentsunder the hood with every request to create a Custom Payment Capture Session. We strongly recommend upgrading to the latest Forage version if you haven't already.
OrderPaymentRequests Must Be Server-SideTo keep your app secure, requests to create an OrderPayment should only be generated on the server-side.
A POST request to /orders/{order_ref}/payments/ tells Forage’s servers how much to charge an existing PaymentMethod to create a payment associated with an existing Order.
On success, the API responds with a Forage OrderPayment object that represents the one-time charge. The PaymentMethod is not charged until the Order is captured, after a customer submits their PIN via the Forage Checkout UI to authorize the charge.
Use `customer_id`` For OrderPayments
Pass
customer_idin the request to Create anOrderPayment
customer_idhelps Forage's servers more quickly identify and associate the correct customer with theOrderPayment. Whilecustomer_idis not technically a required parameter, if you omit it then the request to create theOrderPaymentcould take longer to process. It is strongly recommended to passcustomer_id.Each customer should only have one unique
customer_id. For example, if you create both anOrderPaymentand aPaymentMethodfor the same customer, then thecustomer_idshould be the same in both requests to ensure continuity of stored payment methods.
Avoid Duplicate
OrderPaymentRequestsOnly create one
OrderPaymentperPaymentMethodassociated with anOrder.The API returns a
400if it identifies a duplicate charge. If you need to increase the amount charged to aPaymentMethodalready associated with anOrder, then update the correspondingOrderPaymentinstead of creating a new one.
