A ddCheckResponseV1 has the following structure:
confirmationNumber Optional String
Max = 15
This value identifies the mandate that you want to update.
This is the confirmationNumber returned by Optimal Payments in response to the original transaction request.
mandateReference Conditional String
Max = 10 For SEPA, Max = 35
This is the mandate reference that allows the account to be charged. This is the value returned for the mandateReference parameter in the response to a ddMandateRequestV1.
You might need to update the
mandateReference, e.g., if the billing terms have changed but all other mandate informa-tion remains the same.
accountNum Conditional String
Max = 17 If IBAN, Max = 32
For SEPA transactions, this is the IBAN (International Bank Account Number) of the customer’s bank account.
You might need to update the accountNum, e.g., if the customer is now going to be billed out of a different account but from the same bank (i.e., where there is no need to change the BIC).
For SEPA transactions, this is the BIC (Bank Identifier Code) of the customer’s bank account.
You would need to update the routingNum, e.g., if the customer has changed banks, in which case the accountNum would also have to be updated.
Table 2-9: ddUpdateMandateRequestV1 Elements (Continued)
Element Child Element Required Type Description
The following elements are relevant for a ddCheckResponseV1:
Table 2-10: ddCheckResponseV1 Elements
Element Child Element Required Type Description
requestId Optional This is the unique ID number returned
by Optimal Payments for a record if it was processed in a batch file.
confirmationNumber Yes String
Max = 15
This is the confirmation number returned by Optimal Payments.
If this is returned in response to a ddUpdateMandateRequestV1, this iden-tifies the new mandate that has been created.
merchantRefNum Optional String
Max = 40
This is the unique ID number associated with the original request. The value is created by the merchant and submitted as part of the original request. This is returned only in response to a lookup request.
mandateReference Yes String Max = 20
This is the mandate reference returned by Optimal Payments. It is either the value echoed back from the request, or if it was not specified correctly in the request, then it is generated by Optimal Payments.
For SEPA, this is the mandate reference created by the merchant in the request.
decision Yes Enumeration This is the status of the transaction. One
of the following is returned:
• Accepted – the transaction was pro-cessed.
• Error – the transaction was attempted, but failed for some rea-son.
• Declined – the transaction was declined before it was sent for pro-cessing.
• Not Found – the transaction lookup did not find any matches.
code Yes Int This is a numeric code that categorizes
the response. See Response codes on page B-1.
actionCode Optional Enumeration This indicates what action to take.
The following values are possible:
• C = Consumer Parameter Error. The consumer has provided incorrect information. Ask the customer to cor-rect the information.
• D = Do Not Retry. Further attempts will fail.
• M = Merchant Parameter Error. Your application has provided incorrect information. Verify your information.
• R = Retry. The problem is temporary.
Retrying the request will likely suc-ceed.
description Optional String
Max = 100
This is a human readable description of the code element.
detail tag Optional String
Max = 1024
This is the classification of the detail ele-ment.
value Optional String
Max = 30
This is the description of the detail.
txnTime Yes dateTime This is the date and time the transaction
was processed by Optimal Payments.
Table 2-10: ddCheckResponseV1 Elements (Continued)
Element Child Element Required Type Description
status Optional
code Conditional Enumeration This is the status of the first transaction that matches a lookup request. Possible values are:
• AP – Active
• C – Complete batch
• CB – Clawed back
• CL – Cleared transaction
• DE – Declined
• MI – Manual intervention required
• PCA – Pending customer approval
• PR1 – Re-Presented 1
• PR2 – Re-Presented 2
• PX – Pending cancel
• RE – Returned
• REF – Rejected final
• RV – Reversed
• T – Transferred
• UM – Unauthorized mandate
• W – Pending
• X – Cancelled
effectiveDate Conditional dateTime • This is the date and time at which the status of the lookup request is in effect.
• When included in the tag/value pair for the detail element for a response to a mandate request, this is the date the mandate will become active with the bank (counting 5 working days from batching time). You may submit a charge request from midnight on this date, or postdate your charge with a txnTime that has a value of this date or later. If you submit a charge with a date before the mandate effectiveDate, you will receive an error.
currency Optional String The value will be one of the currency
codes in Table 3-15: Currency Codes on page 3-55. This value is returned only in response to lookup requests.
amount Optional String
Max = 9999999.99
This is the amount of the first transac-tion that matches a lookup request.
Table 2-10: ddCheckResponseV1 Elements (Continued)
Element Child Element Required Type Description
To process the response:
1. Get the response details, which are available via get() methods of the response.
String responseTxt = ddTxnResponse.code + " - " + ddTxnResponse.decision +
" - " + ddTxnResponse.description;
responseTxt += "Details:" + Environment.NewLine;
if (ddTxnResponse.detail != null) {
for (int i = 0; i < ddTxnResponse.detail.Length; i++) {
responseTxt += " - " + ddTxnResponse.detail[i].tag + " - " + ddTxnResponse.detail[i].value + Environment.NewLine;
} }
responseTxt = responseTxt.Replace("\n", Environment.NewLine);
System.Console.WriteLine(responseTxt);
System.Console.WriteLine("Transaction Failed with decision: " + ddTxnResponse.decision);
transaction Optional This is returned only in response to a
lookup request. All transactions that match the lookup request are returned here.
confirmationNumber Conditional String Max = 15
This is the confirmation number returned by Optimal Payments for a previous transaction.
merchantRefNum Optional String Max = 255
This is the unique ID number associated with the original request. The value is created by the merchant and submitted as part of the original request. This is returned only in response to a lookup request.
txnTime Conditional dateTime This is the date and time the transaction was processed by Optimal Payments.
status Conditional This contains code and effectiveDate
elements for the transaction. See the status element above in this table for details.
amount Conditional String
Max = 9999999.99
This is the amount of the transaction.
Table 2-10: ddCheckResponseV1 Elements (Continued)
Element Child Element Required Type Description
2. Process based on the decision element. You would insert handling code appropriate to your application. You can also look at the code element to provide more fine-grained control for your application. See Response codes on page B-1 for more details.