Worldpay WPG
Gateway Website: https://dashboard.worldpay.com/
Developer Documentation: https://developerengine.fisglobal.com/apis/wpg/directintegration
Default Currency: USD
Gateway Endpoints
This implementation of Worldpay WPG forwards requests to the below endpoints.
Production: https://secure.worldpay.com/jsp/merchant/xml/paymentService.jsp
Sandbox: https://secure-test.worldpay.com/jsp/merchant/xml/paymentService.jsp
Supported Parameters:
* denotes a required field
Field Name | Type | Worldpay WPG Mapping | Notes |
---|---|---|---|
gateway* | string | N/A | WorldpayWPG |
testMode | boolean | N/A | Routes between Test and Production endpoints. All requests sent to the TokenEx test environment are sent to the Worldpay WPG test endpoint. This field value is honored in the TokenEx production environment. TokenEx Test: always true. TokenEx Prod: defaults to false. |
username* | string | merchantCode Basic Auth username | Merchant's Worldpay WPG Username |
password* | string | Base Auth password | Merchant's Worldpay WPG Password |
orderId* | string | order.orderCode orderModification.orderCode | Must have a unique value per order- i.e. the order code must not have been used previously. Can be up to 64 characters in length, or 25 characters if you are connecting to the US domestic acquiring platform. Recommend a minimum of 9 and a maximum of 20 for onward processing. Spaces, quotation marks, code brackets (< and >) and pipes ("|") are not allowed. |
merchantId* | string | paymentService.merchantCode | Same value as username. |
amount | int | order.amount.value modify.capture.value modify.refund.value | Transaction amount in whole units. Example: $10.00 USD should be sent as 1000. |
currencyCode | string | order.amount.currencyCode modify.capture.currencyCode modify.refund.currencyCode | ISO 4217 three-letter alphabetic code for the currency. Defaults to "USD". |
creditCard.number | string | paymentDetails.CARD-SSL.cardNumber | Card's PAN or TokenEx token |
creditCard.FullName | string | paymentDetails.CARD-SSL.cardHolderName | Cardholder's full name. |
creditCard.expYear | int | paymentDetails.CARD-SSL.expiryDate.date.year | 4 digit year. |
creditCard.expMonth | int | paymentDetails.CARD-SSL.expiryDate.date.month | 1 or 2 digit month. |
creditCard.CVV | string | paymentDetails.CARD-SSL.cvc | 3 or 4 digit Card Verification Code. If the CVV has been associated with a TokenEx token, send a non-numeric value here, such as "cvv". The CVV associated with the token will be retrieved and forwarded. |
billingAddress.address1 | string | paymentDetails.CARD-SSL.cardAddress.address.address1 | First line of the street address. |
billingAddress.address2 | string | paymentDetails.CARD-SSL.cardAddress.address.address2 | Second line of the street address. |
billingAddress.city | string | paymentDetails.CARD-SSL.cardAddress.address.city | City or locality. |
billingAddress.state | string | paymentDetails.CARD-SSL.cardAddress.address.state | State or province. |
billingAddress.zip | string | paymentDetails.CARD-SSL.cardAddress.address.zip | ZIP code or postal code. |
billingAddress.country | string | paymentDetails.CARD-SSL.cardAddress.address.country | Customer country. Input Alpha 3. Is converted to Alpha 2. |
orderInfo.InvoiceNumber | string | purchase.invoiceReferenceNumber | Invoice number associated with a transaction. |
orderInfo.CustomerId | string | purchase.customerReference | Customer reference for the purchase |
orderInfo.DiscountAmount | int | purchase.discountAmount.amount.value | The amount of discount for the order. |
orderInfo.ShippingAmount | int | purchase.shippingAmount.amount.value | The shipping cost for the order. |
orderInfo.DutyAmount | int | purchase.dutyAmount.amount.value | The duty on the total purchase amount for the order. |
tax.CardAcceptorTaxId | string | purchase.cardAcceptorTaxId | 9 digits for US domiciled merchants. |
tax.Amount | int | purchase.salesTax.Amount.Value | Amount of sales tax for the order. |
tax.Exempt | boolean | purchase.taxExempt | Set to true if salesTax is 0. |
Example Payloads
{
"testMode": true,
"gateway": "WorldpayWPG",
"username":"<Your Worldpay WPG API Login ID>",
"password":"<Your Worldpay WPG Transaction Key>",
"merchantId": "<Your Worldpay WPG API Login ID>",
"amount": 900,
"creditCard": {
"number": "4111111111111111",
"expMonth": 6,
"expYear": 2024,
"firstName": "John",
"lastName": "Doe",
"cvv": "123"
},
"billingAddress": {
"phone": "555-555-5555",
"email": "[email protected]",
"name": "John Doe",
"company": "Test Co.",
"address1": "123 Someplace Lane, Suite #40A",
"city": "Edmond",
"state": "OK",
"zip": "74100",
"country": "USA"
},
"orderInfo": {
"invoiceNumber": "INV12233566",
"customerId": "CUST00000001",
"discountAmount": 0,
"shippingAmount": 100,
"dutyAmount": 0
},
"tax": {
"cardAcceptorTaxId": "VAT1999292",
"amount": 2400,
"exempt": false
}
{
"testMode": true,
"gateway": "WorldpayWPG",
"username":"<Your Worldpay WPG API Login ID>",
"password":"<Your Worldpay WPG Transaction Key>",
"tokenExTransactionCode": "<TokenExTransactionCode from a previous Authorize response>",
"amount": 900
}
{
"testMode": true,
"gateway": "WorldpayWPG",
"username":"<Your Worldpay WPG API Login ID>",
"password":"<Your Worldpay WPG Transaction Key>",
"tokenExTransactionCode": "<TokenExTransactionCode from a previous Capture or Purchase response>",
"amount": 900
}
{
"testMode": true,
"gateway": "WorldpayWPG",
"username":"<Your Worldpay WPG API Login ID>",
"password":"<Your Worldpay WPG Transaction Key>",
"tokenExTransactionCode": "<TokenExTransactionCode from a previous Auhtorize, Capture, or Purchase response>"
}
Gateway Response Fields:
Field Name | Type | WPG Response Mapping | Notes |
---|---|---|---|
ApprovalCode | string | unmapped | |
Approved | boolean | lastEvent | If primary request returns "AUTHORISED" or OK element is present. |
ProviderTransactionCode | string | Request's order.OrderCode | The order code from the request is echoed in the response from WPG and is the value used for transaction modification. |
Updated 9 months ago