digitickets / omnipay-barclays-epdq

Barclays ePDQ Essential payment gateway integration into the Omnipay library.
MIT License
10 stars 17 forks source link

Examples not working #23

Open ultrono opened 8 years ago

ultrono commented 8 years ago

Hi,

When I attempted to run your examples, I was not able to set Feedback or Page Layout data. I could only set such data if it was set before sending data. E.g. for feedback data:

$purchase = $gateway->purchase();

$purchase->setTransactionId('ORDER-00001'); // Unique ID
$purchase->setAmount(5000); // 50£

$feedback = new Feedback();
$feedback->setComplus('123456789123456789123456789');
$feedback->setParamplus('SessionID=126548354&ShopperID=73541312');

// Set before sending data
$purchase->setFeedback($feedback);

$response = $purchase->send();
coatesap commented 8 years ago

@GhaziTriki - are you able to help out with this question, as I know you provided the code for these elements?

ultrono commented 8 years ago

Actually, will submit some code for this later on in the week when I have time. I only mentioned this as an issue, as when running the examples provided, I was unable to send data to Barclays. The actual code works as described.

It seems even https://www.invoiceninja.com/forums/topic/barclays-payent-gateway/ think the library doesn't work because of the example, which is a shame, as it's a very good implementation that's helped me a lot.

GhaziTriki commented 8 years ago

Hello,

The time that example was written it was working on a production server. The project I was working one didn't need any updated after the implementation. However I don't have any news about it. I had a similar issue before submitting updates to the library, it was outdated. Barclays EPDq is provided by ingenico, so probably barclays have updated their API.

Can you please give more details about the error you have?

ultrono commented 8 years ago

Sure, it's just a small change when setting data using your "Feedback" and "PageLayout" classes. There's no change required and can confirm everything works. The issue with with the examples provided on the readme file.

Additional data needs to be set on the purchase object and set before sending the request to Barclays. E.g. for Feedback:

$purchase = $gateway->purchase();

$purchase->setTransactionId('ORDER-00001'); // Unique ID
$purchase->setAmount(5000); // 50£

$feedback = new Feedback();
$feedback->setComplus('123456789123456789123456789');
$feedback->setParamplus('SessionID=126548354&ShopperID=73541312');

// Set before sending data, was previously: $response->setFeedback($feedback);
$purchase->setFeedback($feedback);

// Then send the response ...
$response = $purchase->send();

Will submit some code for your examples later on in the week when I some spare time.

GhaziTriki commented 8 years ago

If it is working can you please provide a pull request and point us to the documentation from where you have found that feedback needs to be added? It will be helful for reference.

ultrono commented 8 years ago

Sure will do