Shipped orders in Shopp by default processed with authorization-only transactions. This quick guide will show you how to override the behavior so you can automatically authorize and capture payments for shipped orders.

Auto-Capture Shipped Orders

Auto-Capture Shipped Orders

The introduction of a well-design order event system allows Shopp to support authorization-only transactions among others. Prior to 1.2, the only transaction Shopp knew how to run was a complete “sale” transaction, payment authorization with immediate payment capture.

Today, Shopp supports a variety of transaction types. The first step in the transaction workflow is the authorization or auth transaction. It ensures funds are available in the customer’s bank account to cover the transaction and authorizes the merchant to transfer funds from the customer’s account to the merchant’s bank account. This is generally followed by the capture transaction which initiates the movement of the funds from the customer account to the merchant account. Most payment processors support authorization and capture transactions. All payment processors support the authorization with capture transaction, known as a sale transaction in Shopp. Shopp also supports refund and void transaction types which will be discussed in a future WorkShopp article.

Visa and MasterCard rules require that merchants only authorize payments for delayed fullfillment orders until the order ships out. In other words, merchants aren’t supposed to capture the payment until the shipment is handed over to the shipping carrier. It isn’t illegal to authorize and capture payments before shipping. But it puts both the merchant and the customer at higher risk. For this reason, to protect the merchant, Shopp uses authorization-only payment processing for shipped orders. Once an order is shipped out, the merchant can click the Charge button in the Order Manager to capture the funds.

Despite the risks, some merchants still prefer the automatic capture when new orders are placed. It’s a good thing Shopp is designed to be flexible. Shopp allows the processing behavior to be overridden using filter hooks. The code to do this can take a couple forms depending on your needs.

add_filter('shopp_purchase_order_processing', create_function('', 'return "sale";'));

The heavy handed way will take over order processing for all orders processed by any payment gateway. Copy and paste the code above into your theme’s functions.php file. If you prefer, create a new plugin file and add it to the plugin.

If your store is running multiple payment gateways and only want to change the behavior of a specific gateway, you can use a more specific filter hook instead. If you’re using PayPal Payments Pro, for example, you would use the all lowercase version of the module name. For PayPal Payments Pro, the module name would be PayPalPro. For the filter hook, that would make it shopp_purchase_order_paypalpro_processing.

add_filter('shopp_purchase_order_paypalpro_processing', create_function('', 'return "sale";'));

With this code active in either a custom plugin file or your theme’s functions.php file, all payment processing will use the sale method, which will run an authorization and immediate capture transaction.

This introduces you to the flexibility of the Shopp order processing system. Taken even further you could completely override the payment processing. Instead of using one of the built-in payment processing approaches (sale or auth) you could design a custom method for handling payment processing.


Jonathan was born at an early age and began designing and developing shortly after. He is the founder of Ingenesis Limited and Project Lead on the Shopp e-commerce plugin for WordPress. He lives and works in the heart of the midwest US with his family. He fancies himself a designer of code, and is only slightly addicted to coffee.

You must be logged in to post a comment.

© Ingenesis Limited. Shopp™ is a registered trademark of Ingenesis Limited.