I have a web app that sends users to an offsite payment server to complete a transaction, and I'm working on the PHP page that users are returned to upon completion of the transaction. The script uses a lot of variables that are set by the external server, and I'm wondering what are the best practices for testing my script without having to actually go through doing a live transaction.

Do I include a file that sets all those variables to dummy values? Or just set those variables at the beginning of the script? (And then hopefully remember to remove this stuff before putting the script on production.)

  • 2
    Any decent payment solution has a sandbox feature which makes it possible to make a fake payment (or a fake failure) in order to test how your website reacts to different responses from the payment website. – Arseni Mourzenko May 4 '15 at 22:29

It sounds very much like Paypal payments are processed. Paypal allows for sandbox accounts purely for testing purposes.

Here is the link to Paypal testing guide

I heard good things about it from my friends.

  • Hi Vegan -- welcome to stack exchange, and thanks for taking the time to answer. The OP didn't mention Paypal specifically. If the payment system his is interfacing to does not have a sandbox, are there other best practices for testing web apps interfacing to payment systems he can try? – Jay Elston May 8 '15 at 1:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.