1

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.)

1
  • 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.CommentedMay 4, 2015 at 22:29

1 Answer 1

1

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.

1
  • 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?CommentedMay 8, 2015 at 1:45

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.