当前位置: 首页>>代码示例>>PHP>>正文


PHP PayPal::setCancelUrl方法代码示例

本文整理汇总了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);
}
开发者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::setCancelUrl方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。