WebSphere Commerce Version 8.0.4.0

REST API services for Apple Pay on the Web

Mod Pack 4 contains updates to the backend payment system and WebSphere Commerce REST API to ensure that Apple Pay on the Web works correctly.

Table 1. Backend services code
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. PUT store/{storeId}/cart/@self/precheckout
Add unbound payment instruction This service is called if payment type promotion is supported. POST store/{storeId}/cart/@self/payment_instruction
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.
  • GET store/{storeId}/cart/@self
  • GET store/{storeId}/cart/@self/usable_shipping_mode

    This new REST service can get the usable shipping information based on the shopper's address, the usable shipping modes will be returned together with the shipping charge.

Get merchant information Get the merchant configuration information, such as the merchant identifier, country code, display name, supported networks and merchant capabilities. GET store/{storeId}/merchant
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}/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}/cart/@self/applepay_update
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:
  • Removes the unbound payment instruction, if present.
  • Handles the shipping and billing address.
  • Calls OrderProcessCmd to submit this order, which triggers the PrimePayment event in the Payment subsystem and corresponding payment processing logic will be run.
POST: store/{storeId}/cart/@self/applepay_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:
  • Delete the new created order and it’s order items.
  • Delete the address of the order item if it was a dummy address.
If the Apple Pay request is sent from the shopping cart or mini shop cart page:
  • Delete the address of the order item if it was a dummy address.
POST: store/{storeId}/cart/@self/applepay_cancel