Set up checkout
DOCS
Last updated: Sept 23rd, 6:12pm
For every checkout session, your client workflow should follow these steps:
- Get an order ID
- Call one of the three
checkoutWithmethods (for the appropriate payment method type) with anorderID. - After a successful checkout result, capture the payment or authorize then capture the payment.
Get an Order ID
Send the orderID that was generated on your server to your client.
1func fetchOrderID() {23 // Switch this URL to your own authenticated API4 let orderIDURL = NSURL(string: "https://my-merchant-server.com/order_id")!5 let orderIDRequest = NSMutableURLRequest(url: orderIDURL as URL)67 URLSession.shared.dataTask(with: orderIDRequest as URLRequest) { (data, response, error) -> Void in8 // Handle errors9 // Obtain orderID10 self.orderID = String(data: data!, encoding: String.Encoding.utf8)1112 }.resume()13}
Next step
Set up different ways to pay: