Processing an Order

Finally when the user has reviewed the Order and entered in their Payment information, you may process the order using the following method.

Currently the only acceptable payment strategy is through Stripe and you can use our StripePaymentProvider SDK together with the UI SDK to collect and process payment info.

This call will asynchronously return a Receipt which you can show to the user as a successful confirmation of the order.

Traveler.processOrder(order, payment: payment) { (receipt, order) in 

}

Alternatively you can use the delegate pattern

Traveler.processOrder(order, payment: payment, delegate: self)
extension MyViewController: OrderProcessDelegate {
    func order(_ order: Order, didSucceedWithReceipt receipt: Receipt) {
    
    }
    
    func order(_ order: Order, didFailWithError error: Error) {
    
    }
}

Last updated