Today I am really happy. I get to wear my wizard hat!!
I’ll be working for another #WordPressWebsite developer writing PHP code to make WordPress integrate with an online payments platform.
This is a little different than the usual integration. Normally, one type of payment is processed, and it is a done deal. For this developer’s client, two different types of payments need to be processed; a subscription and a purchase of product(s).
Behind the scenes, payments are assigned types, and are actually sent to different physical locations to process (even though it is electronic). When processing payments, you can’t set up a subscription (which is processed through one channel) AND purchase product(s) in the same transaction.
With programming code intervention, you can process one type through regular channels, then pick up the “success” signal of the first transaction, and force through another “purchase” by manually (with programming code) constructing a new payment of a different type. That is why you have to recognize “success” on the payment platform’s end, and send another transaction.
The Plan: First the code will send the payments platform information to create a customer and add a subscription for that customer. As a subscription, the payment processor will set up a recurrent billing situation in preparation for automatically sending invoices and processing subsequent renewals. That is the easy part.
Step 2: Upon success of that transaction, the programming code will figure out how many products were ordered (0 – 3), tally the total and add tax, then manually create a new payment, and submit that to the payment processor – or not – if zero products were ordered.
Step 3: Upon completion of that transaction, a message will display for the client indicating the results of the two transactions – appearing as though it were a single transaction. Any failure along the way will be noted.
Sending two subsequent transactions of two different types in a row is new for me. I’m looking forward to the challenge!