Request a payment from the customer by sending an Apple Pay payment request.
A payment request starts when a customer service agent with the business asks you to send a payment request to a customer. You should create a
data dictionary to collect and store information about the payment request.
The first piece of information to collect is a payment session object. To get it, ask Apple Pay to start a new payment session (see Requesting an Apple Pay Payment Session). Apple Pay returns a payment session object which you add to the ApplePayMerchantSession dictionary in the
Next, add the ApplePayPaymentRequest dictionary keys to the
data dictionary. This is where you specify transaction details such as the purchase amount, payment processing capabilities, available shipping methods, and a list of items or services purchased. You can also request billing and shipping address information through the ApplePayPaymentRequest dictionary.
Finally, add the ApplePayEndpoints dictionary keys to the
data dictionary. This dictionary identifies the endpoints needed to process the payment and receive any updates a customer might make before confirming the payment, such as updating the shipping address or changing the shipping method.
After constructing the data dictionary, send it to Business Chat as part of an interactive message (see Sending a Custom Interactive Message). Business Chat forwards the payment request to the customer's device, and the customer authorizes the payment from the Apple Pay payment sheet using Touch ID or Face ID. The device then sends the payment information, including the encrypted Apple Pay token and any requested customer contact information, to the
payment endpoint listed in the endpoints dictionary. After processing the payment, the merchant sends the transaction results to the customer's device, which in turn sends the results to you to let you know the payment request is complete.