<dependency>
<groupId>com.broadleafcommerce.microservices</groupId>
<artifactId>broadleaf-amazonpaymentservices</artifactId>
</dependency>
Users must first register a sandbox account with Amazon Pay Services (Payfort).
Next, familiarize yourself with the Amazon Pay Services Payfort API before proceeding
Once you have registered a merchant account with Amazon Pay Services, add the Broadleaf Amazon Pay Services Maven dependency to your PaymentTransactionServices project.
<dependency>
<groupId>com.broadleafcommerce.microservices</groupId>
<artifactId>broadleaf-amazonpaymentservices</artifactId>
</dependency>
Note
|
The dependency’s version will be pulled from the Broadleaf release train pom.xml .
|
Via the Amazon Payment Services dashboard, the following configurations should be set:
1. Return Url Type: POST
2. Response Type: JSON
3. Downgrade CVC: NO
Webhooks are used as a secondary means of gathering transaction results, in case they’re unable to be communicated synchronously when the transaction is requested. Additionally, APS will occasionally communicate that transaction results are "pending" and they’ll notify us of the result via their Notification Feedback URL.
Via the Amazon Payment Services dashboard add Direct Transaction Feedback and Notification URLs:
{your_url_to_payment_transaction_services}/webhooks/AMAZON_PAYMENT_SERVICES?tenantId={your_tenant_id}
Other Amazon Payment Services configurations to consider: 1. Origin IP - Used to restrict ability to call APS servers 2. Origin URL - Used to restrict ability to call APS servers
Next, you will need to gather the following configuration properties from your merchant account on Amazon Pay Services and add them to your application via system properties.
Merchant ID
Access Code
Signature Request SHA Phrase
Signature Response SHA Phrase
Signature Algorithm
broadleaf.amazonpaymentservices.merchant-id={Your merchant id}
broadleaf.amazonpaymentservices.access-code={Your access code}
broadleaf.amazonpaymentservices.default-language={Your application's default language} (Default used if not provided in payment request)
broadleaf.amazonpaymentservices.default-return-url={Your application's default return URL} (Default used if not provided in payment request)
broadleaf.amazonpaymentservices.signature.request-sha-phrase={Your request sha phrase}
broadleaf.amazonpaymentservices.signature.response-sha-phrase={Your response sha phrase}
broadleaf.amazonpaymentservices.signature.algorithm={Your signature algorithm} (Defaulted to SHA-512. Possible values are [HmacSHA256, HmacSHA512, SHA-256, SHA-512].)
Add the following properties to declare the AMAZON_PAYMENT_SERVICES
gateway as an available payment method.
broadleaf:
cartoperation:
service:
checkout:
checkout-payment-method-options:
- payment-method-type: CREDIT_CARD
payment-method-gateway-type: AMAZON_PAYMENT_SERVICES
AMAZON_PAYMENT_SERVICES
should be added to the following property to declare when transactions for this gateway should be executed, relative to other gateways, during checkout processing.
broadleaf:
cartoperation:
service:
checkout:
payment-gateway-priorities:
- ...
- AMAZON_PAYMENT_SERVICES
- ...
By default, Authorize transactions are executed by CartOps during checkout. If you wish to execute AuthorizeAndCapture transactions instead, define the following property:
broadleaf:
cartoperation:
service:
checkout:
checkout-transaction-types:
AMAZON_PAYMENT_SERVICES: AUTHORIZE_AND_CAPTURE
Note
|
This property is application-discriminated, allowing different values to be provided on a per-tenant or per-application basis using the following property paths:
"mytenant" & "myapplication" being the Broadleaf Tenant and Application ids. |
AMAZON_PAYMENT_SERVICES
should be added to the following property to declare when ReverseAuthorize or Refund transactions for this gateway should be executed, relative to other gateways, when cancelling a fulfillment.
broadleaf:
orderoperation:
service:
payment:
cancel-payment-gateway-priorities:
- ...
- AMAZON_PAYMENT_SERVICES
- ...
AMAZON_PAYMENT_SERVICES
should be added to the following property to declare when Capture transactions for this gateway should be executed, relative to other gateways, when capturing payment for a fulfillment.
broadleaf:
orderoperation:
service:
payment:
capture-payment-gateway-priorities:
- ...
- AMAZON_PAYMENT_SERVICES
- ...
AMAZON_PAYMENT_SERVICES
should be added to the following property to declare when Refund transactions for this gateway should be executed, relative to other gateways, when refunding payment for a fulfillment return.
broadleaf:
orderoperation:
service:
payment:
refund-payment-gateway-priorities:
- ...
- AMAZON_PAYMENT_SERVICES
- ...