Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free.

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

share|improve this question
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. –  MainMa May 4 at 22:29

1 Answer 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.

share|improve this answer
    
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 at 1:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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