-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Try to get the numbers from the accountNumber in the response body #136
base: master
Are you sure you want to change the base?
Conversation
…rs from the accountNumber in the response body
This gets the last card digits, which is great, but I'm not sure where the expiry date is coming from. I get "199912" every time, regardless of what the actual expiry date is, which looks like it may be the default that Omnipay returns (which seems like a big to me). I can't see the expiry date in the raw payload either for the AJS response, so maybe it's not needed, or is ignored? Or maybe the XML is not being parsed correctly? object(SimpleXMLElement)#29 (13) {
["responseCode"]=>
string(1) "1"
["authCode"]=>
string(6) "000000"
["avsResultCode"]=>
string(1) "P"
["cvvResultCode"]=>
object(SimpleXMLElement)#31 (0) {
}
["cavvResultCode"]=>
object(SimpleXMLElement)#42 (0) {
}
["transId"]=>
string(1) "0"
["refTransID"]=>
object(SimpleXMLElement)#51 (0) {
}
["transHash"]=>
object(SimpleXMLElement)#32 (0) {
}
["testRequest"]=>
string(1) "1"
["accountNumber"]=>
string(8) "XXXX0027"
["accountType"]=>
string(4) "Visa"
["messages"]=>
object(SimpleXMLElement)#48 (1) {
["message"]=>
object(SimpleXMLElement)#44 (2) {
["code"]=>
string(1) "1"
["description"]=>
string(35) "This transaction has been approved."
}
}
["transHashSha2"]=>
string(128) "70BADC10C279FD5102EC17DDB18225E46CBD1381C3E06C85976A5727415DA9E6BFAA758ABF15D1B6745D41D18FD355E0AFED8E5E5E7FCD06D34B0216E108EE48"
} |
The raw AJS (using opaque data) rtesponse body: <?xml version="1.0" encoding="UTF-8"?>
<createTransactionResponse xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<refId>313826278</refId>
<messages>
<resultCode>Ok</resultCode>
<message>
<code>I00001</code>
<text>Successful.</text>
</message>
</messages>
<transactionResponse>
<responseCode>1</responseCode>
<authCode>000000</authCode>
<avsResultCode>P</avsResultCode>
<cvvResultCode />
<cavvResultCode />
<transId>0</transId>
<refTransID />
<transHash />
<testRequest>1</testRequest>
<accountNumber>XXXX0027</accountNumber>
<accountType>Visa</accountType>
<messages>
<message>
<code>1</code>
<description>This transaction has been approved.</description>
</message>
</messages>
<transHashSha2>70BADC10C279FD5102EC17DDB18225E46CBD1381C3E06C85976A5727415DA9E6BFAA758ABF15D1B6745D41D18FD355E0AFED8E5E5E7FCD06D34B0216E108EE48</transHashSha2>
</transactionResponse>
</createTransactionResponse> No expiry dates in there. Does it work for you if you drop the expiry date altogether when the card object does not have it set for the request? |
Looking at this example here: https://developer.authorize.net/api/reference/features/acceptjs.html#Integrating_Accept.js_into_Your_Payment_Form the payment form has names for the expiry date fields. That means although the card number (and CVV) are not captured direct to the merchant site, the month and year are captured directly. I wonder if the month and year need to be captured with the user |
@judgej it's seems you are correct, that the expiration date is still needed even though it is not returned in the response and it is not sent in the request to authorize.net. The new error I got, after successfully storing and sending the card number is:
For the expiration date I get The solution for regular accept.js usage is probably to store the card details which are provided by accept.js when available. I'm trying to use Apple Pay, which does not supply the card number or the expiration date. This pull request can most likely be declined for another solution for storing the card data. |
If last four numbers of the card aren't present in the card object (because the payment was done with opaqueData), try to get the numbers from the accountNumber in the response body.
This is so that refunds can be done for transactions without a card, like apple pay or when using Accept.js.
This is really to solve digital-pros/commerce-authorize#15