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 "processorData": {
103 "external_ids": {
104 "authorization_id": "54B297038E2016701"
105 }
106 }
107 }
108}

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.
eventTypestringOptional

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

datedatetimeOptional

The date-time that the webhook was sent.

notificationConfigobjectOptional

The notification configuration details.

versionstringOptional

The payload version

paymentobjectOptional

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 "processorData": {
22 "string": {}
23 },
24 "paymentMethod": {
25 "descriptor": "string",
26 "paymentType": "FIRST_PAYMENT",
27 "paymentMethodToken": "string",
28 "vaultedPaymentMethodToken": "string",
29 "analyticsId": "string",
30 "paymentMethodType": "string",
31 "paymentMethodData": {
32 "first6Digits": "string",
33 "last4Digits": "string",
34 "expirationMonth": "string",
35 "expirationYear": "string",
36 "cardholderName": "string",
37 "network": "string",
38 "isNetworkTokenized": true,
39 "binData": {
40 "network": "string",
41 "issuerCountryCode": "AW",
42 "issuerName": "string",
43 "issuerCurrencyCode": "AED",
44 "regionalRestriction": "DOMESTIC_USE_ONLY",
45 "accountNumberType": "PRIMARY_ACCOUNT_NUMBER",
46 "accountFundingType": "CREDIT",
47 "prepaidReloadableIndicator": "RELOADABLE",
48 "productUsageType": "CONSUMER",
49 "productCode": "string",
50 "productName": "string"
51 }
52 },
53 "threeDSecureAuthentication": {
54 "responseCode": "NOT_PERFORMED",
55 "reasonCode": "GATEWAY_UNAVAILABLE",
56 "reasonText": "string",
57 "protocolVersion": "string",
58 "challengeIssued": true
59 }
60 },
61 "processor": {
62 "name": "string",
63 "processorMerchantId": "string",
64 "amountCaptured": 0,
65 "amountRefunded": 0
66 },
67 "statusReason": {
68 "type": "APPLICATION_ERROR",
69 "declineType": "SOFT_DECLINE",
70 "code": "ERROR",
71 "message": "string"
72 },
73 "transactions": [
74 {
75 "processorMerchantId": "string",
76 "transactionType": "SALE",
77 "processorTransactionId": "string",
78 "processorName": "string",
79 "processorStatus": "PENDING",
80 "processorStatusReason": {
81 "type": "APPLICATION_ERROR",
82 "declineType": "SOFT_DECLINE",
83 "code": "ERROR",
84 "message": "string"
85 }
86 }
87 ],
88 "riskData": {
89 "fraudChecks": {
90 "source": "string",
91 "preAuthorizationResult": "ACCEPT",
92 "postAuthorizationResult": "ACCEPT"
93 },
94 "cvvCheck": {
95 "source": "string",
96 "result": "MATCHED"
97 },
98 "avsCheck": {
99 "source": "string",
100 "result": {
101 "streetAddress": "MATCHED",
102 "postalCode": "MATCHED"
103 }
104 }
105 }
106 }
107}