Gift card payment properties

When the Generic Payment webhook executes, it sends a JSON request body to the payment gateway.

The request body contains information about the order and about the method of payment. The gateway processes the request and returns a JSON response body that contains information about the transaction, including whether the transaction succeeded.

The set of properties in the request and response bodies, including the subobjects, vary depending on the type of transaction. For gift card gateways, there are four transaction types supported: authorize, void, refund, and balance inquiry.

Gift card payment request properties

This section describes the top-level properties and the properties of subobjects sent in the JSON request body of the Generic Payment webhook for gift card transactions. Note that if the includeOrderInWebhookPayload property in the gateway extension's config.json file is set to true, the order is also included in the request. See Order Submit webhook for information about the order properties.

Top-level properties

The following table describes the top-level properties that Oracle Commerce sends in the webhook request.

Property Description
transactionType

A code indicating the type of transaction. This must be one of the following numeric values:

0100 (authorize)
0110 (void)
0400 (refund)
0600 (balance inquiry)
channel

The area of the system where the payment-processing request originated. Valid values are:

storefront
agent
preview
orderId The ID of the order associated with the payment
currencyCode The ISO 4217 currency code.
locale The shopper’s locale, taken from the order. If no locale is set, the default locale from the storefront is used.
siteId The ID of the site on which the order was placed
siteURL The URL of the site on which the order was placed
retryPaymentCount The number of times payment has been retried for the order
customProperties Additional key/value pairs from the submitted order to be sent to the provider

paymentRequests properties

The following table describes the properties of paymentRequests objects that Oracle Commerce sends in the webhook request.

Property Description
paymentId The ID of the internal payment group.
transactionId The unique ID of the transaction. Consists of the order ID, the payment ID, and the transaction timestamp (in milliseconds), separated by hyphens.
transactionTimestamp

The timestamp of the transaction, expressed as an ISO 8601 value in the following format:

yyyy-MM-dd'T'HH:mm:ssZ

paymentMethod The payment method. For a gift card, the value is physicalGiftCard.
amount The expected amount of the transaction. The value of this property is a positive, 12-digit number that is expressed in base currency. For example, $125.75 is represented as 000000012575.
gatewayId The ID of the payment gateway.
customProperties Additional key/value pairs from the submitted order to be sent to the provider.

cardDetails properties

The following table describes the properties of the cardDetails object sent in a gift card authorization request or balance inquiry.

Property Description
giftCardNumber The number that uniquely identifies the gift card
giftCardPin The security code for authenticating the gift card

referenceInfos properties

The following table describes the properties of the referenceInfos objects sent in a gift card void request or refund request. The values of these properties are taken from the original authorization transaction so the merchant can map the void or refund to it.

Property Description
merchantTransactionId The transaction reference ID from the merchant
hostTransactionId The transaction reference ID from the payment gateway

billingAddress properties

The following table describes the properties of the billingAddress object in the request. The billing address is the address of the shopper to whom the order is charged.

Property Description
lastName The last name of the shopper
postalCode The postal code in the address (for example, the zip code in the United States)
phoneNumber The phone number associated with the address
email The email address associated with the address
state The state in the address
address1 The first line of the address. Typically the street and number.
address2 The second line of the address. Included as an empty string in the JSON data if no value exists in the order.
firstName The first name of the shopper
city The city in the address
country The country in the address

shippingAddress properties

The following table describes the properties of the shippingAddress object in the request. The shipping address is the address of the person (not necessarily the shopper) receiving the order.

Property Description
lastName The last name of the order recipient
postalCode The postal code in the address (for example, the zip code in the United States)
phoneNumber The phone number associated with the address
email The email address associated with the address
state The state in the address
address1 The first line of the address. Typically the street and number.
address2 The second line of the address. Included as an empty string in the JSON data if no value exists in the order.
firstName The first name of the order recipient
city The city in the address
country The country in the address

profile properties

The following table describes the properties of the profile object in the request. These values are associated with the shopper purchasing the order.

Property Description
id The ID of the shopper profile
phoneNumber The phone number from the shopper profile
email The email address from the shopper profile

profileDetails properties

The following table describes the properties of the profileDetails object in the request. These values are associated with the customer purchasing the order. Note that for account-based commerce shoppers, this object may also include parentOrganization, currentOrganization, and secondaryOrganizations subobjects.

Property Description
id The ID of the customer profile
lastName The last name of the customer profile
firstName The first name of the customer profile
middleName The middle name of the customer profile
email The email address from the customer profile
taxExempt Indicates whether the customer tax-exempt status; either true or false
taxExemptionCode For a customer with tax-exempt status, the exemption code
profileType The type of profile; either b2c_user or b2b_user
receiveEmail Indicates whether the customer agrees to receive email; either yes or no
registrationDate

The timestamp of when the profile was created, expressed as an ISO 8601 value in the following format:

yyyy-MM-dd'T'HH:mm:ssZ

lastPasswordUpdate

The timestamp of when the password for the profile was last updated, expressed as an ISO 8601 value in the following format:

yyyy-MM-dd'T'HH:mm:ssZ

Sample authorization request

The following is an example of a gift card authorization request:

{
   "transactionType": "0100",
   "currencyCode": "USD",
   "locale": "en",
   "customProperties": { },
   "channel": "storefront",
   "siteId": "siteUS",
   "siteURL": "https://www.example.com",
   "orderId": "o50415",
   "paymentRequests": [
      {
         "transactionId": "o50415-pg50417-1464958982609",
         "paymentId": "pg50417",
         "customProperties": { },
         "gatewaySettings": {
            "paymentMethodTypes":"physicalGiftCard"
         },
         "cardDetails":{
            "giftCardNumber": "12393678",
            "giftCardPin": ""
         },
         "amount":"000000002499",
         "billingAddress": { },
         "transactionTimestamp": "2019-12-03T13:03:02+0000",
         "referenceInfos": { },
         "shippingAddress": { },
         "paymentMethod": "physicalGiftCard",
         "gatewayId": "demoGiftCardGateway",
      }
   ],
   "profile": {
      "id": "120002",
      "phoneNumber": "1234512345",
      "email": "ab@abc.com"
   }
   "profileDetails": {
       "id": "120002",
       "lastName": "Shopper",
       "firstName": "Test",
       "taxExempt": false,
       "profileType": "b2c_user",
       "receiveEmail": "no",
       "registrationDate": "2019-10-15T06:50:51.000Z",
       "lastPasswordUpdate": "2019-10-15T06:50:51.000Z",
   }
}

Gift card payment response properties

This section describes the top-level properties and the properties of subobjects that should be returned in the response body of the Generic Payment webhook for gift card transactions.

Top-level properties

The following table describes the top-level properties that Oracle Commerce expects in the webhook response.

Property Description
transactionType

A code indicating the type of transaction. This must be one of the following numeric values:

0100 (authorize)
0110 (void)
0400 (refund)
0600 (balance inquiry)
currencyCode The ISO 4217 currency code. This is expected to match the value in the request.
locale The shopper’s locale. This is expected to match the value in the request.
channel The area of the system where the payment-processing request originated. This is expected to match the value in the request.
orderId The ID of the order associated with the payment. This is expected to match the value in the request.
siteId The ID of the site on which the order was placed. Must match the value from the request.

authorizationResponse, voidResponse, creditResponse, and inquireBalanceResponse properties

The following table describes the properties of the authorizationResponse, voidResponse, creditResponse, or inquireBalanceResponse objects in the webhook response. Only one of these object types is included in each response (the object type corresponding to the transaction type; for example, a voidResponse object for a void transaction). All of these object types require the same set of properties. The values of these properties indicate the results of the transaction.

Property Description
responseCode

The decision from the payment provider as interpreted by the merchant. The acceptable values depend on the transaction type. For an authorization request, the code must be one of the following values:

1000 (success)
4000 (sale complete)
9000 (decline)

For a void request, the code must be one of the following values:

2000 (success)
8000 (decline)

For a credit (refund) request, the code must be one of the following values:

3000 (success)
7000 (decline)

For a balance inquiry, the code must be one of the following values:

5000 (success)
6000 (decline)
responseDescription Information from the payment gateway about the response
responseReason Information about why the transaction succeeded or failed
hostTransactionId The transaction reference ID from the payment gateway
merchantTransactionId The transaction reference ID from the merchant
paymentId The ID of the internal payment group. Must match the value from the request
transactionId The unique ID of the transaction. Consists of the order ID, the payment ID, and the transaction timestamp (in milliseconds), separated by hyphens. Must match the value from the request.
transactionTimestamp

The timestamp of the transaction in Oracle Commerce, expressed as an ISO 8601 value in the following format:

yyyy-MM-dd'T'HH:mm:ssZ

Must match the value from the request.

paymentMethod The payment method. Must match the value from the request. For a gift card, the value is physicalGiftCard.
amount

The actual amount of the transaction. This may differ from the amount in the request.

The value of this property is a positive, 12-digit number that is expressed in base currency. For example, $125.75 is represented as 000000012575.

merchantTransactionTimeStamp The timestamp of the transaction from the merchant (in milliseconds)
hostTransactionTimeStamp The timestamp of the transaction from the gateway (in milliseconds)
gatewayId The ID of the payment gateway. Must match the value from the request
additionalProperties Key/value pairs for additional properties sent by the merchant

Sample authorization response

The following is an example of a response to a gift card authorization request:

{
   "transactionType": "0100",
   "currencyCode": "USD",
   "locale": "en",
   "channel": "storefront",
   "siteId": "siteUS",
   "orderId": "o50415",
   "authorizationResponse":
      [{
         "merchantTransactionTimestamp": "1464958982654",
         "responseCode": "1000",
         "hostTransactionId": "hID1464958982554",
         "transactionId": "o50415-pg50417-1464958982609",
         "paymentId": "pg50417",
         "responseDescription": "AuthResponseDescription",
         "merchantTransactionId": "mID1464958982654v",
         "amount": "000000002999",
         "additionalProperties": {
            "sample-addnl-property-key4": "sample-payment-property-value4",
            "sample-addnl-property-key2": "sample-payment-property-value2",
            "sample-addnl-property-key3": "sample-payment-property-value3",
            "sample-addnl-property-key1": "sample-payment-property-value1"
         },
         "hostTransactionTimestamp": "1464958982554",
         "responseReason": "AuthResponseReason",
         "transactionTimestamp": "2019-12-03T13:03:02+0000",
         "paymentMethod": "physicalGiftCard",
         "gatewayId": "demoGiftCardGateway"
      }]
}