public function doPayment() { $ctid = $this->getData_Unstaged_Escaped('contribution_tracking_id'); $this->normalizeOrderID($ctid); $this->addRequestData(array('order_id' => $ctid)); if ($this->getData_Unstaged_Escaped('recurring')) { $resultData = $this->do_transaction('DonateRecurring'); } else { $country = $this->getData_Unstaged_Escaped('country'); if (in_array($country, $this->getGlobal('XclickCountries'))) { $resultData = $this->do_transaction('DonateXclick'); } else { $resultData = $this->do_transaction('Donate'); } } return PaymentResult::fromResults($resultData, $this->getFinalStatus()); }
/** * Note that the Amazon adapter is somewhat unique in that it uses a third * party SDK to make all processor API calls. Since we're never calling * do_transaction and friends, we synthesize a PaymentTransactionResponse * to hold any errors returned from the SDK. */ public function doPayment() { $this->client = $this->getPwaClient(); $this->transaction_response = new PaymentTransactionResponse(); if ($this->session_getData('sequence')) { $this->regenerateOrderID(); } try { if ($this->getData_Unstaged_Escaped('recurring') === '1') { $this->confirmBillingAgreement(); $this->authorizeAndCapturePayment(true); } else { $this->confirmOrderReference(); $this->authorizeAndCapturePayment(false); } } catch (ResponseProcessingException $ex) { $this->handleErrors($ex, $this->transaction_response); } $this->incrementSequenceNumber(); return PaymentResult::fromResults($this->transaction_response, $this->getFinalStatus()); }
public function doPayment() { if ($this->getData_Unstaged_Escaped('recurring')) { // Build the billing agreement and get a token to redirect. $resultData = $this->do_transaction('SetExpressCheckout_recurring'); } else { // Returns a token which we use to build a redirect URL into the // PayPal flow. $resultData = $this->do_transaction('SetExpressCheckout'); } return PaymentResult::fromResults($resultData, $this->getFinalStatus()); }
function doPayment() { return PaymentResult::fromResults($this->do_transaction('donate'), $this->getFinalStatus()); }
/** * Cancel a subscription * * Uses the adapter's internal order ID. * * @return PaymentResult */ public function cancelSubscription() { // Try to cancel, in case no payment attempts have been made or all // payment attempts can be canceled $response = $this->do_transaction('CANCEL_ORDER'); if (!$response->getCommunicationStatus()) { // If we can't cancel, end it to disallow future attempts $response = $this->do_transaction('END_ORDER'); if (!$response->getCommunicationStatus()) { return PaymentResult::fromResults($response, FinalStatus::FAILED); } } return PaymentResult::fromResults($response, FinalStatus::COMPLETE); }
function doPayment() { // If this is not our first NewInvoice call, get a fresh order ID if ($this->session_getData('sequence')) { $this->regenerateOrderID(); } $transaction_result = $this->do_transaction('NewInvoice'); $this->runAntifraudFilters(); if ($this->getValidationAction() !== 'process') { $this->finalizeInternalStatus(FinalStatus::FAILED); } $result = PaymentResult::fromResults($transaction_result, $this->getFinalStatus()); return $result; }