in reply to Daemon to test credit-card authorization?

I've done quite a bit CC stuff over the years and every processor does things a bit differently. For example the test environment is always different (some have test card numbers, some have test servers).

But, there are quite a few things in common too (mostly the data they need). Usually there are example scripts (often in Perl) that you can get started quick with too.

I use this scheme:

Site > Sanitiser > CC Processor

Basically, I don't code anything that is CC specific in the site and anything that a CC Processor needs I add to the sanitiser step. The CC Processor step usually ends up being only one subroutine. If I switch processors (which doesn't happen very often) I rewrite the last step and maybe add a few things to the Sanitiser step.

It will never be easy switching CC processors, but I have found that this scheme does make it fairly painless.

  • Comment on Re: Daemon to test credit-card authorization?

Replies are listed 'Best First'.
Re^2: Daemon to test credit-card authorization?
by locked_user sundialsvc4 (Abbot) on Jan 30, 2009 at 16:46 UTC

    That is an appealing idea. Could you please elaborate on specifics?

    In reference to the Business:: module spoken-of earlier, do you use it? And if so, how exactly does it fit into your “scheme?”

    (Obviously, I do intend to use “CPAN something,” as I have done with every other aspect of this project. I simply want to reserve my personal head-banging for the most interesting things.)

      Well, it depends on your processor. For example, I have used PayPal Payflow Pro and have had great success with it. And there are quite a few Business::PayPal modules on CPAN.

      I would start with your processor and see if you can find anything on CPAN. If you use some obscure payment method you might be stuck writing your own. Either way, the scheme I mentioned earlier will help... just don't get your processor entangled into your web app or you may be doing some head-banging later on.

      Looking back (it has been about a year since I have used Payflow) but it was a little quarky then. Hopefully, it is better developed now (on the PayPal side). Once I got everything sorted out during development it ran great in production.