One Time Donation API

POST {{baseUrl}}/payments

This API is used to process One Time Donation for a Registered User. The user can either use an already added card or a new card for the payment. The field 'cardId' will be present only for the existing card flow, the card details (PAN, cvc, expiry info) are not required in this scenario hence shouldn't be part of the request body. In case of the new card flow, the request body will not be having a cardId field only the card details will be present. Entire request body should be encrypted.

Request Body

{"donorId"=>"652ce9ff-fa5f-4e9f-8151-c73fa20088f7", "donation"=>{"amount"=>"11", "charityId"=>"ae3c5f35-084a-4df9-a2af-7e0efd512fc0", "donationType"=>"ONE-TIME"}, "cardId"=>"ebee3d81-18d4-409a-8330-73db083f2cfc", "card"=>{"primaryAccountNumber"=>"cupidatatcupidat", "CardExpiryDetails"=>{"expirymonth"=>"ea", "expiryYear"=>"ipsu"}, "cvc"=>"tem"}, "pspVersion"=>"51", "source"=>"Widget", "authPayerResponse"=>{"authentication"=>{"3ds"=>{"authenticationToken"=>"kHyn+7YFi1EUAREAAAAvNUe6Hv8=", "transactionId"=>"9f343e5d-fc28-4818-88d4-17a35fb7dea9", "version"=>"1.0.2", "acsEci"=>"es"}, "3ds2"=>{"transactionStatus"=>"Y", "protocolVersion"=>"2.2.2"}}}}

HEADERS

KeyDatatypeRequiredDescription
x-openapi-clientidstring(Required) ClientId is a unique and a mandatory ID shared while creating a project on Mastercard Developers Portal.
x-correlation-idstringCorrelationId is a unique donation request ID. It is recommended to pass the x-correlation-id by the customer and to use the format "bankname_UUID" (bank name can be indicated using the first 4 digits). Maximum length of this field should be 100 alphanumeric characters. If not passed, Mastercard will generate it. Note: If there is a timeout when doing the one time api call, it is important to redo the same api call with same x-correlation-id to get the status of the previous api call
x-program-idstringProgramId is an optional field, but if a client has more than one program associated to it, then this field becomes mandatory.
Content-Typestring
Acceptstring

RESPONSES

status: Created

{"Errors":{"Error":[{"Source":"Gateway","ReasonCode":"CREATED","Description":"OAuth signatures did not match.","Recoverable":false,"Details":"null"},{"Source":"Gateway","ReasonCode":"CREATED","Description":"OAuth signatures did not match.","Recoverable":false,"Details":"null"}]}}