Response of invoice payment

Response of invoice payment
  • In the response InvoiceDTO object along with additional data will be passed back to merchant, including last payment attempt (transaction) data:
Field Description
InvoiceDTO object from invoice creation response, plus additional payment_transaction object fields:
id Unique transaction identifier
amount Transaction amount (will match invoice amount)
payment_id Payment identifier from the upstream payment provider. If the payment transaction is IN_PROGRESS state, payment_id will be null
target_payment_id Additional payment identifier from the upstream payment provider
reversal_amount For reversed transaction - reversed amount
currency Transaction currency (will match invoice currency)
reversal_currency For reversed transaction - reversed currency
minor_amount Same transaction amount in minor units (e.g. in cents for EUR currency)
created_date Transaction creation date
updated_date Transaction update date
transaction_type General transaction type (inherited from invoice in the reduced form, without 3Ds definition)
status
Transaction state.
PENDING – transaction will continue after additional customer actions are done (in this case - MPI validation retrieval);
SUCCEEDED – transaction succeeded, and therefore parent invoice status should be SUCCEEDED as well;
FAILED – current transaction failed, but parent invoice can still be SUCCEEDED if subsequent payment retry for the same invoice will be successful;
CANCELLED – DMS payment 2nd step was cancelled by merchant request
REJECTED – DMS payment 2nd step was cancelled by the issuer bank
error_code Transaction error identifier (if any)
error_message Transaction brief error description (if any)
shop_code Shop code (will match invoice shop code)
invoice_ref Parent invoice reference
  • Additional objects (besides "invoice" and "payment_transaction") can be passed in the response:
Object Description
view
Current view for cardholder notification about payment process:

card – Card data must be supplied to advance this invoice processing;
redirect – Merchant must execute cardholder browser redirect to MPI form for further payment authentication;
error – Merchant should notify cardholder about failed payment;
finished – Merchant should notify cardholder about succeeded payment.
action In case of required 3D-Secure authentication, this field will contain URL to submit required data for MPI verification
method In case of required 3D-Secure authentication, this field will contain required HTTP method name to proceed with MPI (GET or POST)
inputs In case of required 3D-Secure authentication, this field will contain additional parameters that should be submitted to "action" URL via "method" method
Response of invoice payment example
  {
  "invoice": {
    "type": "InvoiceDto",
    "invoice_ref": "oS0kg9HovkKoEIly5WDM8Oat1",
    "amount": 10.00,
    "currency": "EUR",
    "created_date": "2017-03-29T15:51:20.027Z",
    "updated_date": "2017-03-29T15:51:20.045Z",
    "due_date": "2017-03-30T15:51:20.027Z",
    "shop_code": "TEST",
    "invoice_status": "IN_PROGRESS",
    "payment_id": null,
    "target_payment_id": null,
    "order_id": "order-659",
    "error_code": null,
    "error_message": null,
    "payment_method": "FD_SMS_3D_OPTIONAL",
    "merchant_name_a": "",
    "merchant_name_b": "",
    "customer": {},
    "products": [],
    "details": {}
    },
    "payment_transaction": {
    "id": 97892,
    "amount": 4.00,
    "payment_id": null,
    "target_payment_id": null,
    "reversal_amount": null,
    "currency": "EUR",
    "reversal_currency": null,
    "minor_amount": 400,
    "created_date": "2017-03-29T15:51:20.042Z",
    "updated_date": "2017-03-29T15:51:20.080Z",
    "transaction_type": "SMS",
    "status": "PENDING",
    "error_code": null,
    "error_message": null,
    "shop_code": "TEST",
    "invoice_ref": "oS0kg9HovkKoEIly5WDM8Oat1"
    },
    "action": "https://acs-web-test.firstdata.lv/mdpayacsnew/pareq",
      "method": "POST",
    "inputs": {
    "MD": "OIMJPuT5Ec2GKmU700I42NDW_128NSAoAEB5Myj3dxgyJwcLRbkk8vSk5IRb2b9a5Vs9VRgjfF55jw5VqjoslQ==",
    "PaReq": "eJxVkduOgjAQhlv1qyqU4=",
    "TermUrl": "https://secureshop-test.firstdata.lv:443/mdpaympi/MerchantServer?msgid=201206"
    },
    "view": "redirect"
 }
	        
  • In this example customer browser must be redirected via POST-form submission to the address https://acs-web-test.firstdata.lv/mdpayacsnew/pareq and the form must have 3 (hidden) fields - MD, PaReq and TermUrl.
  • After MPI verification customer will be redirected using same approach - via POST form submission to the URL, specified in the "mpi_callback_url" field.