REST API services for Apple Pay on the Web
The Accelerator assets contain manual updates to the backend payment system and WebSphere Commerce REST API to ensure that Apple Pay on the Web works correctly.
ApplePayHandler
is a new resource handler that contains all the REST services
that are created for Apple Pay on the Web. This resource handler is available in the following
location.
com.ibm.commerce.applepay.rest.handler.ApplePayHandler
REST service name | Description | REST service |
---|---|---|
Create Apple Pay order | If a shopper clicks the apple pay button from product display page, the create apple pay
order creates a new pending order for this shopper. The apple pay order can be created by using the
existing order service and by passing the parameter as orderId=** . |
POST store/{storeId}/cart/@self |
Prepare Apple Pay order | The prepare Apple Pay order service is called before rendering the payment sheet, this
service is implemented by ApplePayOrderPrepareCmd service.
|
POST store/{storeId}/applepay/cart/prepare |
Get Order information | Get order service is called after ApplePayPrepare . It retrieves the data
that is provided to payment sheet, including the order and order items details, such as the order
total, discount, shipping, tax,. Get order service retrieves the available shipping addresses and
shipping methods. For each shipping method, it gets the shipping charge for each shipping
method. |
A new implementation class
ComposeUsableShippingInfoWithShippingChargeCmdImpl is created for access profiles
such as IBM_UsableShippingInfo . In this new class, it composes the available
shipping method and the shipping charge for each shipping method.
|
Merchant validation | Merchant validation is required for every Apple Pay on the Web session. It is used to ensure
that your site is secure and available for Apple Pay. It first gets the merchant validation URL from
Safari, then gets the merchant session from Apple Pay's server in the backend, and passes the
merchant session object to ApplePayJS . |
POST store/{storeId}/applepay/merchant/validate |
Update Apple Pay Order | Apple Pay order update service is called by onshippingcontactselected event
or onshippingmethodselected event, which is when shopper update the shipping
address, contact or shipping method. The apple pay order item's addressId or
shimodeId is updated in the service. This service is implemented by the
ApplePayOrderUpdateCmd command. |
PUT: store/{storeId}/applepay/cart |
Process Apple Pay Order | The Apple Pay order process service is called by onpaymentauthorized
callback function. This service is implemented by the ApplePayOrderProcessCmd
command, which includes the following logic:
|
POST: store/{storeId}/applepay/cart/process |
Cancel Apple Pay order | The Cancel Apple Pay order service is called by the oncancel callback
function. This service is implemented by the ApplePayOrderCancelCmd command, which
includes the following logic:If the Apple Pay request is sent from the product details page:
If the Apple Pay request is sent from the shopping cart or mini shop cart page:
|
POST: store/{storeId}/applepay/cart/cancel |
Payment Service Provider interaction | Payment Service Provider (PSP) interaction is handled by the
com.ibm.commerce.applepay.payment.commands.ProcessApplePayPaymentCmd task
command.This task command is invoked by the WebSphere Commerce Payment subsystem to respond to
the You must implement the In the sample assets,
a dummy implementation for |