本文整理匯總了PHP中PayPal::setCancelUrl方法的典型用法代碼示例。如果您正苦於以下問題:PHP PayPal::setCancelUrl方法的具體用法?PHP PayPal::setCancelUrl怎麽用?PHP PayPal::setCancelUrl使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PayPal
的用法示例。
在下文中一共展示了PayPal::setCancelUrl方法的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);
}
示例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";