當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PayPal::setReturnUrl方法代碼示例

本文整理匯總了PHP中PayPal::setReturnUrl方法的典型用法代碼示例。如果您正苦於以下問題:PHP PayPal::setReturnUrl方法的具體用法?PHP PayPal::setReturnUrl怎麽用?PHP PayPal::setReturnUrl使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PayPal的用法示例。


在下文中一共展示了PayPal::setReturnUrl方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: create_paypal_PaymentMethod

function create_paypal_PaymentMethod()
{
    $uniqueValue = get_unique_value();
    $merchantAccountId = 'account-' . $uniqueValue;
    $merchantPaymentMethodId = 'pm-' . $uniqueValue;
    $email = get_unique_value() . '@nomail.com';
    $successUrl = 'http://good.com/';
    //need a trailing slash
    $errorUrl = 'http://bad.com/';
    //need a trailing slash
    $name = 'John Vindicia';
    $addr1 = '303 Twin Dolphin Drive';
    $city = 'Redwood City';
    $district = 'CA';
    $postalCode = '94065';
    $country = 'US';
    $address = new Address();
    $address->setName($name);
    $address->setAddr1($addr1);
    $address->setCity($city);
    $address->setDistrict($district);
    $address->setPostalCode($postalCode);
    $address->setCountry($country);
    $paymentmethod = new PaymentMethod();
    $paymentmethod->setType('PayPal');
    $paymentmethod->setAccountHolderName($name);
    $paymentmethod->setBillingAddress($address);
    $paymentmethod->setMerchantPaymentMethodId($merchantPaymentMethodId);
    $paymentmethod->setCurrency('USD');
    $paypal = new PayPal();
    $paypal->setReturnUrl($successUrl);
    $paypal->setCancelUrl($errorUrl);
    $paymentmethod->setPaypal($paypal);
    $account = new Account();
    $account->setMerchantAccountId($merchantAccountId);
    $account->setEmailAddress($email);
    $account->setShippingAddress($address);
    $account->setEmailTypePreference('html');
    $account->setName($name);
    //$account->setPaymentMethods(array($paymentmethod));
    //return $account;
    return array('account' => $account, 'paymentmethod' => $paymentmethod);
}
開發者ID:sheller-vin,項目名稱:CashBoxAPISamples,代碼行數:43,代碼來源:paypalAutoBill.php

示例2: PayPal

<?php

require_once 'Vindicia/Soap/Vindicia.php';
require_once 'Vindicia/Soap/Const.php';
$ab = $argv[1];
$pmId = $argv[2];
print "autobill is {$ab}\n";
$paypal = new PayPal();
$paypal->setReturnUrl('http://localhost:8888/success.php');
$paypal->setCancelUrl('http://localhost:8888/cancellation.php');
$paypal->setRequestReferenceId(1);
$pm = new PaymentMethod();
$pm->setMerchantPaymentMethodId($pmId);
$pm->setType('PayPal');
$pm->setPayPal($paypal);
$autobill = new AutoBill();
$autobill->setMerchantAutoBillId($ab);
$autobill->setPaymentMethod($pm);
$immediateAuthFailurePolicy = 'doNotSaveAutoBill';
$validateForFuturePayment = 0;
$fraudScore = 100;
$ignoreAVS = 1;
$ignoreCVN = 1;
$dryrun = 1;
$dryrun = $argv[3];
$coupon = NULL;
$response = $autobill->update('', $immediateAuthFailurePolicy, $validateForFuturePayment, $fraudScore, $ignoreAVS, $ignoreCVN, $coupon, $dryrun, '');
print_r($response);
$return_code = $response['returnCode'];
$return_string = $response['returnString'];
print "Return code is {$return_code} \n";
開發者ID:sheller-vin,項目名稱:CashBoxAPISamples,代碼行數:31,代碼來源:AutoBill_update_PayPal_PM.php


注:本文中的PayPal::setReturnUrl方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。