eWAYPayment / eway-rapid-php

Eway Rapid PHP library
https://www.eway.com.au
MIT License
14 stars 24 forks source link

Undefined property 'TransactionStatus' in class 'Eway\Rapid\Model\Response\CreateTransactionResponse' #28

Open shangguan-chenxi opened 2 years ago

shangguan-chenxi commented 2 years ago

array(3) { ["Customer"]=> array(1) { ["CardDetails"]=> array(5) { ["Name"]=> string(10) "John Smith" ["Number"]=> string(16) "4444333322221111" ["ExpiryMonth"]=> string(2) "12" ["ExpiryYear"]=> string(2) "25" ["CVN"]=> string(3) "123" } } ["Payment"]=> array(1) { ["TotalAmount"]=> int(1000) } ["TransactionType"]=> string(8) "Purchase" } Notice: Undefined property 'TransactionStatus' in class 'Eway\Rapid\Model\Response\CreateTransactionResponse' in C:\Users\hp\Desktop\lifeByteSrv\eway-rapid-php-master\src\Rapid\Model\Support\HasAttributesTrait.php on line 199

Above are the output information I got, I totally copied and pasted the example code then replaced the apiKey and apiPassword (also cpoied from the sandBox Business Centre)

I had printed the $response and find the following: object(Eway\Rapid\Model\Response\CreateTransactionResponse)#9 (3) { ["fillable":protected]=> array(17) { [0]=> string(10) "AccessCode" [1]=> string(17) "AuthorisationCode" [2]=> string(11) "BeagleScore" [3]=> string(19) "CompleteCheckoutURL" [4]=> string(8) "Customer" [5]=> string(6) "Errors" [6]=> string(13) "FormActionURL" [7]=> string(7) "Payment" [8]=> string(12) "ResponseCode" [9]=> string(15) "ResponseMessage" [10]=> string(16) "SharedPaymentUrl" [11]=> string(11) "TotalAmount" [12]=> string(13) "TransactionID" [13]=> string(17) "TransactionStatus" [14]=> string(15) "TransactionType" [15]=> string(12) "Verification" [16]=> string(19) "AmexECEncryptedData" } ["errors":protected]=> array(1) { [0]=> string(5) "S9992" } ["attributes":protected]=> array(1) { ["Errors"]=> string(0) "" } } According to the "errors", I found S9992 error code; refer to the documentation, it meanss "Error connecting to Rapid gateway", but the php can definitely have access to the public internet

Any solution to this?

shangguan-chenxi commented 2 years ago

Problem solved, solution from StackOverflow

What you need to do is update your certificate. On your server upload this file - https://curl.haxx.se/ca/cacert.pem Make sure its not in your www folder, somewhere only apache can access. Then in your php.ini file add this line to the bottom: curl.cainfo=C:\wamp\certificates\cacert-2016-11-02.pem Replace C:\wamp\certificates\cacert-2016-11-02.pem with the path of the certificate you just uploaded. Restart your server. It should now start working. Here is some more information: Update WAMP/Apache to use new cacert.pem https://curl.haxx.se/docs/caextract.html