On This Page
Sale
Use this information to process a sale transaction. This type of transaction combines an
authorization and a capture into a single transaction.
Follow these steps to process a sale.
- Create aChargeParametersobject and provide the required information for the payment.
- Use thestartChargeTransactionmethod to initiate the transaction flow.let chargeParameters = ChargeParameters(amount: Decimal(1.00), currency: .USD, customIdentifier: "yourReferenceForTheTransaction") let charge = await mposUi.startChargeTransaction(with: chargeParameters)
- When the transaction is complete, you can view the result of the transaction.switch charge { case .success(let transaction): print("Transaction with id: %@ completed with state: %@", transaction.identifier, transaction.status) case .failure(let error): print("Transaction failed with error: %@", error.localizedDescription) }
- To get complete transaction details, access thetransactionobject.