Information on creating a new processor backend to go with Business::OnlineThirdPartyPayment. ----------------------------------------------------------- NOTE: You should read the notes in Business::OnlinePayment first. Create a subclass of Business::OnlineThirdPartyPayment called Business::OnlineThirdPartyPayment::(processor name). You should override at least the set_defaults, create, and execute methods. See Business::OnlineThirdPartyPayment::PayPal as an example. create(%content): This method's primary functions are: - to determine/create the URL the purchaser must visit to make payment, and - to assign a token to the transaction. %content will always include 'amount' (the amount of the payment) and 'description' (a text description of the product being purchased). If the processor requires the merchant to initiate the transaction (e.g. PayPal), then create() should do that, and store the transaction ID assigned by the processor in 'token'. Otherwise, create() can simply assign a semi-random, unique string to 'token', and additionally pass it to the processor as the order number or other identifier. The URL the purchaser needs to visit should be assigned to the 'redirect' property of the object. If the processor expects to receive the transaction parameters from the purchaser's browser in the form of a POST request, create() can store them in a hashref in the 'post_params' property. execute(%params): This method's primary function is to determine whether the transaction was successful. The 'token' property should already be set to whatever it was after the initial create(). %params is everything passed back by the processor to the callback URL. If the merchant is required to confirm or "capture" the payment after authorization, execute() should do that. (PayPal again.) Other processors (see B:OTP:FCMB for an example) provide a separate API to query the transaction status; execute() should do that. In either case, it should set the 'is_success' property to 0 or 1, and set 'error_message' if the payment failed, or 'order_number' and 'authorization' if it succeeded. set_defaults(%arguments): This is called from the constructor. The build_subs() method of Business::OnlinePayment is available for creating accessor methods. In general, modules should look for the merchant ID in 'username', any password or shared secret in 'password', and the callback URL in 'return_url'.