/** * Processes an Order Payment * See APP_Gateway::process() * @param APP_Order $order Order to process * @param array $options User inputted options * @return void */ public function process($order, $options) { if (!empty($options['pdt_enabled'])) { if (APP_Paypal_PDT::can_be_handled()) { $transaction = APP_Paypal_PDT::get_transaction($_GET['tx'], $options['pdt_key'], !empty($options['sandbox_enabled'])); if ($transaction) { $this->bridge->process_single($transaction); } else { $this->fail_order(__('PayPal has responded to your transaction as invalid. Please contact site owner.', APP_TD)); } } else { $this->create_form($order, $options); } return; } // Otherwise, validate regularly if ($this->is_returning()) { $order->complete(); } else { $this->create_form($order, $options); } }