On This Page
Tap to Pay on iPhone Payment Services
Use this information to process the payment services featured in the Tap to Pay on iPhone
Solution.
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.
Refund
Use this information to process a refund using a reference to the original transaction for a full
or partial transaction amount. Stand-alone credits are also supported in this
Acceptance Devices solution. For more information, see Stand-Alone Credit.
Follow these steps to process a refund.
- Use therefundTransactionmethod to start the transaction flow.let linkedRefund = await mposUi.refundTransaction(withID: "transactionIdentifier", //Specify amount and currency for partial refunds partiallyWithAmount: (Decimal(1.00), .USD))
- When the transaction is complete, you can view the result of the transaction.switch linkedRefund { case .success(let transaction): print("Transaction with id: %@ completed with state: %@", transaction.identifier, transaction.status) case .cancelledByUser: print("Transaction canceled.") case .error(let developerInfo): print("Transaction failed. Info: %@", developerInfo) }
- To get complete transaction details, access thetransactionobject.
Stand-Alone Credit
Use this information to process a stand-alone credit. This transaction is used to process a
credit without reference to the original transaction. The customer is required to
present their payment card for this type of transaction.
WARNING
When processing a stand-alone credit, there is no limit on the
credit amount because there is no reference to the original transaction amount. The
recommendation is to use a refund transaction whenever possible. For more
information, see Refund.
Follow these steps to process a stand-alone credit.
- Create aRefundParametersobject and provide the required information for the payment.
- Use thestartStandaloneRefundTransactionmethod to initiate the transaction flow.let refundParameters = RefundParameters(amount: Decimal(1.00), currency: .USD, customIdentifier: "yourReferenceForTheTransaction") let refund = await mposUi.startStandaloneRefundTransaction(with: refundParameters)
- After the transaction is completed, get the results of the transaction.switch refund { 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.
Check Transaction Status
Use this information to check the status of a transaction.
Check Transaction Status Using the showSummary Method
showSummary
MethodTo submit a check transaction status request, you must have the
transactionIdentifier
value for the transaction that you want to
check.Use the check transaction status request to obtain response data for a transaction
that was lost or timed out. When you send the request using the
showSummary
method, the transaction details are shown on the
Summary screen. Follow these steps to request a check transaction status.
- Use theshowSummarymethod to open the Summary screen.let summary = await mposUi.showSummary(forID: "transactionIdentifier")
- After the activity is complete, you can view the results of the activity.switch summary { case .success(let transaction): print("Summary screen was shown for transaction with id %@", transaction.identifier) case .failure(let error): print("Error checking transaction status or displaying summary screen: %@", error.localizedDescription) }
- To view the full transaction details, access thetransactionobject.
Check Transaction Status Using the lookupTransaction Method
lookupTransaction
Method To submit a check transaction status request, you must have the
transactionIdentifier
value for the transaction that you want to
check.Use the check transaction status request to obtain response data for a transaction
that was lost or timed out. When you send the request using the
lookupTransaction
method, the transaction details are shown in
the transaction
object. Follow these steps to request a check transaction status.
- Use thelookupTransactionmethod to find the transaction details.let result = await mposUI.lookupTransaction(forID: "transactionIdentifier")
- After the activity is complete, you can view the results of the activity.switch result { case .success(let transaction): print("Lookup successful for id %@", transaction.identifier) case .notFound: print("Transaction not found.") case .networkError(let developerInfo): print("Lookup failed. Info: %@", developerInfo) case .unexepcted(let developerInfo): print("Lookup failed. Info: %@", developerInfo) }
- To view the full transaction details, access thetransactionobject.
Sale with On-Reader Tipping
Use this information to process a sale with on-reader tipping. At the start of each
transaction, the device prompts the customer to add a tip by showing suggested tip
amounts and a no-tip option. The customer chooses or enters an amount before
presenting their payment card.
Follow these steps to process a sale with on-reader tipping.
- Create aChargeParametersobject and provide the required information for the payment.
- Use thestartChargeTransactionmethod to initiate the transaction flow.// Use to display three tipping percentage choices let tipConfig = Tipping.percentageChoice([5, 10, 15]) // Use to ask for tip amount // let tipConfig = Tipping.input(.tipAmount()) // Use to ask for total transaction amount including tip // let tipConfig = Tipping.input(.totalAmount()) let chargeParameters = ChargeParameters(amount: Decimal(1.00), currency: .USD, customIdentifier: "yourReferenceForTheTransaction", tip: tipConfig) let charge = await mposUi.startChargeTransaction(with: chargeParameters)
- After the transaction is completed, get the results 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.
Pre-Authorization
Use this information to process a pre-authorization for an initial amount. This
transaction places a temporary hold on the customer's payment card. The transaction
amount can be captured at a later time.
Most authorizations expire in 5 to 7 days. The issuing bank sets this period of time.
When an authorization expires with the issuing bank, your bank or processor might
require you to re-submit an authorization request and include a request for capture
in the same message. For more information, see Capture.
Follow these steps to process a pre-authorization.
- 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", autocapture: false) let charge = await mposUi.startChargeTransaction(with: chargeParameters)
- After the transaction is completed, get the results 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.
Incremental Authorization
Use this information to process an incremental authorization. This transaction can be
applied to a pre-authorization request to increase the authorized amount before it
is captured.
Follow these steps to process an incremental authorization.
- Use theincrementTransactionmethod to initiate the transaction flow.let increment = await mposUi.incrementTransaction(withID: "transactionIdentifier", withAmount: (Decimal(1.00), .USD))
- After the transaction is completed, get the results of the transaction.switch increment { case .success(let transaction): print("Transaction with id: %@ completed with state: %@", transaction.identifier, transaction.status) case .cancelledByUser: print("Transaction canceled.") case .error(let developerInfo): print("Transaction failed. Info: %@", developerInfo) }
- To get complete transaction details, access thetransactionobject.
Capture
Use this information to capture a pre-authorized transaction. The capture request references the
approved pre-authorization request.
Follow these steps to process a capture.
- Use thecaptureTransactionmethod to start the transaction flow.let capture = await mposUi.captureTransaction(withID: "transactionIdentifier", //Specify amount and currency for partial captures partiallyWithAmount: (Decimal(1.00), .USD))
- After the transaction is completed, get the results of the transaction.switch capture { case .success(let transaction): print("Transaction with id: %@ completed with state: %@", transaction.identifier, transaction.status) case .cancelledByUser: print("Transaction canceled.") case .error(let developerInfo): print("Transaction failed. Info: %@", developerInfo)
- To get complete transaction details, access thetransactionobject.
Email a Customer Receipt
Use this information to email the receipt for a previous transaction to a customer.
Follow these steps to email a customer receipt.
- Use thesendEmailReceiptmethod to start the flow for emailing a receipt.let email = await mposUi.sendEmailReceipt(forID: "transactionIdentifier")
- After the emailing activity is completed, get the results of the activity.switch email { case .success: print("Operation completed.") case .cancelByUser: print("Operation canceled.") case .error(let developerInfo): print("Operation failed. Info: %@", developerInfo) }