コード例 #1
0
 public function createRecurringPaymentProfile()
 {
     // ini_set("soap.wsdl_cache_enabled", 0);
     $paypal = $this->getHandler('DoCreateRecurringPaymentsProfile');
     $paypal->setParams($this->data['token']);
     $paypal->setRecurringItems($this->details->getRecurringItems());
     $executionResponse = $paypal->execute();
     if (is_array($executionResponse) && count($executionResponse) > 0) {
         $express = ExpressCheckout::getInstanceByOrder($this->details->getOrder());
         $paymentData = @unserialize($express->paymentData->get());
         if (!is_array($paymentData)) {
             $paymentData = array();
         }
         $paymentData['PayPalRecurringProfiles'] = $executionResponse;
         $express->paymentData->set(serialize($paymentData));
         $express->save();
     }
     return true;
 }
コード例 #2
0
ファイル: example.php プロジェクト: rafasashi/paypal-1
<?php

require_once "express_checkout.php";
$uid = "MERCHANT ACCOUNT ID";
$password = "******";
$signature = "MERCHANT ACCOUNT SIGNATURE";
$checkout = new ExpressCheckout($uid, $password, $signature);
if ($_GET["token"]) {
    $userData = $checkout->getCheckoutDetails();
    print_r($userData);
    $payResponse = $checkout->completeCheckout();
    echo "<br /><br /><br />";
    print_r($payResponse);
} else {
    $urlSuccess = "http://localhost/sample.php";
    $urlFailure = "http://localhost/sample.php?status=cancel";
    $postData = array("AMT" => "10", "cancelUrl" => $urlFailure, "returnUrl" => $urlSuccess);
    $checkout->setCheckout($postData);
}
コード例 #3
0
 private function validateExpressCheckout()
 {
     if ($redirect = $this->validateOrder($this->order, self::STEP_PAYMENT)) {
         return $redirect;
     }
     $expressInstance = ExpressCheckout::getInstanceByOrder($this->order);
     if (!$expressInstance) {
         return new ActionRedirectResponse('order', 'index');
     }
     $this->order->setPaymentMethod(get_class($expressInstance));
     try {
         $handler = $expressInstance->getTransactionDetails($this->getTransaction());
     } catch (PaymentException $e) {
         $expressInstance->delete();
         return new ActionRedirectResponse('checkout', 'express', array('id' => $expressInstance->method->get()));
     }
     return $expressInstance;
 }
コード例 #4
0
ファイル: SiteController.php プロジェクト: anmolview/yiidemos
 public function actionPaypalReturn()
 {
     $e = new ExpressCheckout();
     if (isset($_REQUEST['token'])) {
         $paymentDetails = $e->getPaymentDetails($_REQUEST['token']);
         if ($paymentDetails['ACK'] == "Success") {
             $ack = $e->doPayment($paymentDetails);
             $this->render("paypal_success", array('ack' => $ack));
         } else {
             $this->render("paypal_error", array('ack' => $ack));
         }
     }
 }
コード例 #5
0
ファイル: CustomerOrder.php プロジェクト: GregerA/livecart
 public function cancelRecurring($currencyID = 'USD')
 {
     // ~
     // getTransaction()
     $this->loadAll();
     $transaction = new LiveCartTransaction($this, Currency::getValidInstanceById($currencyID));
     // ~
     $expressInstance = ExpressCheckout::getInstanceByOrder($this);
     $handler = $expressInstance->getHandler($transaction);
     $status = $handler->cancelRecurring();
     return $status;
 }