Payment Status Update

Primer notifies you with a PAYMENT.STATUS webhook when a payment’s status has been updated. This is especially useful for asyncronous processor Connections, which do not respond with an upfront authorization. The webhook events will arrive in the order that the payment status changes, for example you should expect a status of PENDING, then AUTHORIZED, then SETTLED (depending on how your workflow is set up). The webhook body contains the full payment object.

Example payment status notification:

1{
2 "eventType":"PAYMENT.STATUS",
3 "date":"2021-02-21T15:36:16.367687",
4 "notificationConfig":{
5 "id":"cc51f9f0-7e1c-492b-9d37-f83a818f6070",
6 "description":"Payment webhook"
7 },
8 "version":"2.3",
9 "signedAt": "1689221338",
10 "payment":{
11 "id":"DdRZ6YY0",
12 "date":"2021-02-21T15:34:16.367687",
13 "dateUpdated":"2021-02-21T15:35:16.133701",
14 "amount":3000,
15 "currencyCode":"GBP",
16 "customerId":"cust-123",
17 "orderId":"order-123",
18 "status":"SETTLED",
19 "cardTokenType":"CARD_PAN",
20 "customer": {
21 "emailAddress": "test@primer.io",
22 "mobileNumber": "0123456789",
23 "billingAddress": {
24 "firstName": "John",
25 "postalCode": "CB94BQ",
26 "addressLine1": "10001 Alpha St",
27 "countryCode": "GB",
28 "city": "Cambridge",
29 "state": "Cambridgeshire"
30 }
31 },
32 "paymentMethod":{
33 "paymentType":"FIRST_PAYMENT",
34 "paymentMethodToken":"-lcWjvBAAs2DnIRXwxNjUzNTYzNjIy",
35 "isVaulted": "false",
36 "analyticsId":"LUi5pETUaVsdSEamK25L",
37 "paymentMethodType":"PAYMENT_CARD",
38 "paymentMethodData":{
39 "last4Digits":"1111",
40 "first6Digits": "411111",
41 "expirationMonth":"03",
42 "expirationYear":"2030",
43 "cardholderName":"ADYEN",
44 "network":"Visa",
45 "isNetworkTokenized":false,
46 "binData":{
47 "network":"VISA",
48 "issuerCountryCode":"US",
49 "issuerName":"JPMORGAN CHASE BANK, N.A.",
50 "regionalRestriction":"UNKNOWN",
51 "accountNumberType":"UNKNOWN",
52 "accountFundingType":"UNKNOWN",
53 "prepaidReloadableIndicator":"NOT_APPLICABLE",
54 "productUsageType":"UNKNOWN",
55 "productCode":"UNKNOWN",
56 "productName":"UNKNOWN"
57 }
58 },
59 "authorizationType": "FINAL",
60 "threeDSecureAuthentication":{
61 "responseCode":"NOT_PERFORMED"
62 }
63 },
64 "processor":{
65 "name":"STRIPE",
66 "processorMerchantId":"acct_1GORasdasqNWFwi8c",
67 "amountCaptured":3000,
68 "amountRefunded":0
69 },
70 "transactions":[
71 {
72 "date":"2021-02-21T15:34:16.367687",
73 "amount":3000,
74 "currencyCode":"GBP",
75 "transactionType":"SALE",
76 "orderId":"order-123",
77 "processorTransactionId":"pi_3L3edsGZasdasdc1iget38p",
78 "processorName":"STRIPE",
79 "processorMerchantId":"acct_1GORasvasdNWFwi8c",
80 "processorStatus":"SETTLED",
81 "cardTokenType":"CARD_PAN"
82 }
83 ],
84 "riskData":{
85 "fraudChecks":{
86 "source":"riskified",
87 "preAuthorizationResult":"THREE_DS",
88 "postAuthorizationResult":"ACCEPT"
89 },
90 "cvvCheck": {
91 "source": "processor",
92 "result": "MATCHED"
93 },
94 "avsCheck": {
95 "source": "processor",
96 "result": {
97 "streetAddress": "NOT_MATCHED",
98 "postalCode": "NOT_VERIFIED"
99 }
100 }
101 }
102 }
103}

Learn more about how Primer handles webhooks.

Headers

X-Signature-PrimarystringRequired

An HMAC signature generated using the webhook payload and a shared signing secret. This is then converted to a base64 encoded string.

X-Signature-SecondarystringRequired
A secondary signature that is added when you have rotated your secret within the past 24 hours.

Payload

The payload of this webhook request is an object.
eventType
stringOptional

The type of the webhook raised. PAYMENT.STATUS in this case.

date
datetimeOptional
The date-time that the webhook was sent.
notificationConfig
objectOptional
The notification configuration details.
version
stringOptional
The payload version
payment
objectOptional

Response

200
any
Return a 200 status to indicate that the data was received successfully.
Payload
1{
2 "eventType": "string",
3 "date": "2023-01-01T00:00:00Z",
4 "notificationConfig": {
5 "id": "string",
6 "description": "string"
7 },
8 "version": "string",
9 "payment": {
10 "id": "string",
11 "date": "2023-01-01T00:00:00Z",
12 "dateUpdated": "2023-01-01T00:00:00Z",
13 "status": "PENDING",
14 "orderId": "string",
15 "currencyCode": "string",
16 "amount": 0,
17 "customerId": "string",
18 "metadata": {
19 "string": {}
20 },
21 "paymentMethod": {
22 "descriptor": "string",
23 "paymentType": "FIRST_PAYMENT",
24 "paymentMethodToken": "string",
25 "vaultedPaymentMethodToken": "string",
26 "analyticsId": "string",
27 "paymentMethodType": "string",
28 "paymentMethodData": {
29 "first6Digits": "string",
30 "last4Digits": "string",
31 "expirationMonth": "string",
32 "expirationYear": "string",
33 "cardholderName": "string",
34 "network": "string",
35 "isNetworkTokenized": true,
36 "binData": {
37 "network": "string",
38 "issuerCountryCode": "AW",
39 "issuerName": "string",
40 "issuerCurrencyCode": "AED",
41 "regionalRestriction": "DOMESTIC_USE_ONLY",
42 "accountNumberType": "PRIMARY_ACCOUNT_NUMBER",
43 "accountFundingType": "CREDIT",
44 "prepaidReloadableIndicator": "RELOADABLE",
45 "productUsageType": "CONSUMER",
46 "productCode": "string",
47 "productName": "string"
48 }
49 },
50 "threeDSecureAuthentication": {
51 "responseCode": "NOT_PERFORMED",
52 "reasonCode": "GATEWAY_UNAVAILABLE",
53 "reasonText": "string",
54 "protocolVersion": "string",
55 "challengeIssued": true
56 }
57 },
58 "processor": {
59 "name": "string",
60 "processorMerchantId": "string",
61 "amountCaptured": 0,
62 "amountRefunded": 0
63 },
64 "statusReason": {
65 "type": "APPLICATION_ERROR",
66 "declineType": "SOFT_DECLINE",
67 "code": "ERROR",
68 "message": "string"
69 },
70 "transactions": [
71 {
72 "processorMerchantId": "string",
73 "transactionType": "SALE",
74 "processorTransactionId": "string",
75 "processorName": "string",
76 "processorStatus": "PENDING",
77 "processorStatusReason": {
78 "type": "APPLICATION_ERROR",
79 "declineType": "SOFT_DECLINE",
80 "code": "ERROR",
81 "message": "string"
82 }
83 }
84 ],
85 "riskData": {
86 "fraudChecks": {
87 "source": "string",
88 "preAuthorizationResult": "ACCEPT",
89 "postAuthorizationResult": "ACCEPT"
90 },
91 "cvvCheck": {
92 "source": "string",
93 "result": "MATCHED"
94 },
95 "avsCheck": {
96 "source": "string",
97 "result": {
98 "streetAddress": "MATCHED",
99 "postalCode": "MATCHED"
100 }
101 }
102 }
103 }
104}