Paymentmethods
The Payment Methods resource is responsible for the customer’s paymentmethods. This resource lists all the paymentmethods defined for the customer payment tokens. Selecting a payment method for a purchase is set during the purchase’s order phase.
Orders Paymentmethods Selector
Use a selector to select paymentmethod to use for the purchase. Follow the workflow to read the paymentmethodsinfo and then create a choice to select the paymentmethod to use for the purchase.
Workflow
- Start with paymentmethod-info
GET
the link with rel: selectorGET
the link with rel: choiceGET
the link with rel: chosenGET
the link with rel: descriptionPOST
the choice using the link with rel: selectaction
Read Order Payment Method
Read the payment method currently selected for the order.
Workflow
- Start with order
GET
the link with rel: paymentmethodinfoGET
the link with rel: paymentmethod- Render the response
Response Fields
paymentmethods.payment-token
Type: Name | Description | Type |
---|---|---|
display-name | A description of the payment token to be used for display purposes. | string |
token | The payment token created by a payment tokenization service. | string |
Read Paymentmethod Needinfo From Order
Read payment-needinfo from order. When a paymentmethod needinfo is on the order, it means the payment method has not been selected for the purchase. Follow the workflow to read the needinfo.
Workflow
- Start with order
GET
the link with rel: needinfo- Render the response
Response Fields
controls.info
Type: Name | Description | Type |
---|---|---|
name | The info object’s name. | string |
Read Paymentmethod Needinfo From Purchaseform
Read payment needinfo from the purchase form. When a payment method needinfo is on the purchase form, it means the payment method has not been selected for the purchase. Follow the workflow to read the needinfo.
Workflow
- Start with create-purchase-form
GET
the link with rel: needinfo- Render the response
Response Fields
controls.info
Type: Name | Description | Type |
---|---|---|
name | The info object’s name. | string |
Read Customer Payment Methods
Read the list of available customer payment methods.
Workflow
- Start with profile
GET
the link with rel: paymentmethods- Render the response
Read Customer Payment Method
Read a payment method from the list of available customer payment methods.
Workflow
- Start with paymentmethods
GET
the link with rel: element- Render the response
Response Fields
paymentmethods.payment-token
Type: Name | Description | Type |
---|---|---|
display-name | A description of the payment token to be used for display purposes. | string |
token | The payment token created by a payment tokenization service. | string |
Read Default Payment Method
Read the customer’s default payment method. The default payment method is the first payment method the customer created.
Workflow
- Start with paymentmethods
GET
the link with rel: default- Render the response
Response Fields
paymentmethods.payment-token
Type: Name | Description | Type |
---|---|---|
display-name | A description of the payment token to be used for display purposes. | string |
token | The payment token created by a payment tokenization service. | string |
Delete Payment Method
Delete a payment method from a shopper’s profile. If you delete a payment method that has already been selected for an order, that payment method will be deleted from the profile but not from the order. The payment method will remain selected on the order until that order is purchased.
Workflow
- Start with paymentmethods
GET
the link with rel: elementDELETE
paymentmethod