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


PHP Paypal::request方法代码示例

本文整理汇总了PHP中Paypal::request方法的典型用法代码示例。如果您正苦于以下问题:PHP Paypal::request方法的具体用法?PHP Paypal::request怎么用?PHP Paypal::request使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Paypal的用法示例。


在下文中一共展示了Paypal::request方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: json_encode

$street = $_POST['address'];
$city = $_POST['city'];
$zip = $_POST['postal_code'];
$desc = $_POST['item'];
$carId = $_POST['car_id'];
$caryear = $_POST['caryear'];
$make = $_POST['make'];
$model = $_POST['model'];
$first_name = $_POST['first_name'];
$name = $_POST['first_name'] + " " + $_POST['last_name'];
$email = $_POST['email'];
$phone = $_POST['telephone'];
$country = $_POST['country'];
$price = $_POST['carprice'];
$exterior_color = $_POST['exterior_color'];
$interior_color = $_POST['interior_color'];
$trim = $_POST['trim'];
//Insert into temp table
$link = mysql_connect(DB_HOST, DB_USER, DB_PASS) or die(mysql_error());
mysql_select_db(DB_SYL_NAME, $link) or die('Could not select database.');
$insertQuery = "INSERT INTO temp_car_detail_payment_info ( first_name, last_name, address, telephone, country, city,  postal_code,email, make, model, year, price, exterior_color, interior_color, trim ) VALUES( '" . mysql_real_escape_string($firstName) . "', '" . mysql_real_escape_string($lastName) . "', '" . mysql_real_escape_string($street) . "', '" . mysql_real_escape_string($phone) . "', '" . mysql_real_escape_string($country) . "', '" . mysql_real_escape_string($city) . "', '" . mysql_real_escape_string($zip) . "', '" . mysql_real_escape_string($email) . "', '" . mysql_real_escape_string($make) . "', '" . mysql_real_escape_string($model) . "', '" . mysql_real_escape_string($caryear) . "', '" . mysql_real_escape_string($price) . "', '" . mysql_real_escape_string($exterior_color) . "', '" . mysql_real_escape_string($interior_color) . "', '" . mysql_real_escape_string($trim) . "' )";
$result = mysql_query($insertQuery);
$lastid = mysql_query('select id from temp_car_detail_payment_info order by id DESC limit 0,1');
$lastfetch = mysql_fetch_object($lastid);
$custom = serialize(array("pg" => 1, "ty" => 1, "id" => $lastfetch->id));
$pay = new Paypal();
$currencyCode = 'USD';
$userdata = array('IPADDRESS' => $_SERVER['REMOTE_ADDR'], 'PAYMENTACTION' => 'Sale', 'CREDITCARDTYPE' => $cardType, 'DESC' => $desc, 'ACCT' => $cardNumber, 'EXPDATE' => $expMonth . $expYear, 'CVV2' => $cvv, 'FIRSTNAME' => $firstName, 'LASTNAME' => $lastName, 'EMAIL' => $email, 'SOFTDESCRIPTORCITY' => $email, 'COUNTRYCODE' => 'US', 'CITY' => $city, 'STREET' => $street, 'ZIP' => $zip, 'NOTIFYURL' => 'http://seobrand-dev.com/ipn.php', 'AMT' => $amount, 'CURRENCYCODE' => $currencyCode, 'CUSTOM' => $custom);
$payInfo = $pay->request('DoDirectPayment', $userdata);
echo json_encode($payInfo);
die;
开发者ID:pankajsinghjarial,项目名称:SYLC-NEWSITE,代码行数:31,代码来源:ajax_paypal_direct_payment.php

示例2: Paypal

<?php

require 'paypalClass.php';
$paypal = new Paypal();
// Get Transaction Details
$response = $paypal->request('GetExpressCheckoutDetails', array('TOKEN' => $_GET['token']));
// $amount = $response['PAYMENTINFO_0_AMT'];
// echo '<pre>';
// print_r($_REQUEST);
// print_r($response);
// echo '</pre>';
// echo $_GET['token'];
// echo '<br>';
// echo $_GET['PayerID'];
// echo '<br>';
// Do transaction
$response2 = $paypal->request('DoExpressCheckoutPayment', array('TOKEN' => $_GET['token'], 'PAYERID' => $_GET['PayerID'], 'PAYMENTACTION' => 'Sale', 'PAYMENTREQUEST_0_AMT' => 5, 'PAYMENTREQUEST_0_CURRENCYCODE' => 'EUR'));
echo '<pre>';
print_r($_REQUEST);
echo '</pre>';
开发者ID:PauuloG,项目名称:4L-sticker-front,代码行数:20,代码来源:doCheckout.php

示例3: array

$cCvv2 = $GLOBALS["card_cvv2"];
$bFName = $GLOBALS["bill_first_name"];
$bLName = $GLOBALS["bill_last_name"];
$bState = $GLOBALS["bill_state"];
$bCity = $GLOBALS["bill_city"];
$bAddr = $GLOBALS["bill_address"];
$bZip = $GLOBALS["bill_zip"];
$total = $GLOBALS["bill_total"];
$desc = $GLOBALS["bill_desc"];
$requestParams = array("IPADDRESS" => $_SERVER["REMOTE_ADDR"], "PAYMENTACTION" => "Sale");
$creditCardDetails = array("CREDITCARDDTYPE" => $cType, "ACCT" => $cNum, "EXPDATE" => $cExp, "CVV2" => $cCvv2);
$payerDetails = array("FIRSTNAME" => $bFName, "LASTNAME" => $bLName, "COUNTRYCODE" => "US", "STATE" => $bState, "CITY" => $bCity, "STREET" => $bAddr, "ZIP" => $bZip);
$orderParams = array("AMT" => $total, "ITEMAMT" => $total, "SHIPPINGAMT" => "0", "CURRENCYCODE" => "USD");
$item = array("L_NAME0" => "Venango Music Together", "L_DESC0" => $desc, "L_AMT0" => $total, "L_QTY0" => "1");
$paypal = new Paypal();
$response = $paypal->request("DoDirectPayment", $requestParams + $creditCardDetails + $payerDetails + $orderParams + $item);
if (is_array($response) && $response["ACK"] == "Success") {
    //Payment successful
    $transactionId = $response["TRANSACTIONID"];
    if ($response["ACK"] == "Success") {
        $responseId = 0;
    } else {
        if ($response["ACK"] == "SuccessWithWarning") {
            $responseId = 1;
        } else {
            if ($response["ACK"] == "Failure") {
                $responseId = 2;
            } else {
                if ($response["ACK"] == "FailureWithWarning") {
                    $responseId = 3;
                } else {
开发者ID:AmnesiAsc,项目名称:cuddly-robot,代码行数:31,代码来源:process_payment.php

示例4: Paypal

<?php

require 'paypalClass.php';
if (isset($_GET["amount"])) {
    $amount = $_GET["amount"];
    if ($amount <= 3) {
        $amount = 3;
    }
} else {
    $amount = 3;
}
$paypal = new Paypal();
$params = array('RETURNURL' => 'http://4l-front.dev/paypal/doCheckout.php', 'CANCELURL' => 'http://4l-front.dev/', 'PAYMENTREQUEST_0_AMT' => $amount, 'PAYMENTREQUEST_0_CURRENCYCODE' => 'EUR');
$token = $paypal->request('SetExpressCheckout', $params);
if ($token) {
    $url = "https://www.sandbox.paypal.com/webscr?cmd=_express-checkout&useraction=commit&token=" . $token;
    // echo $token;
    header("Location: {$url}");
    exit;
}
开发者ID:PauuloG,项目名称:4L-sticker-front,代码行数:20,代码来源:requestCheckout.php

示例5: array

         case 'Day':
             $period = __('day', 'ait');
             break;
     }
     $recurringDescription = $rolePrice . ' ' . $currencyCode . ' ' . __('per', 'ait') . ' ' . $period;
     $recurringDescriptionFull = $rolePrice . ' ' . $currencyCode . ' ' . __('per', 'ait') . ' ' . $period . ' ' . __('for', 'ait') . ' ' . $packageName;
     // Recurring payments
     $recurring = array('L_BILLINGTYPE0' => 'RecurringPayments', 'L_BILLINGAGREEMENTDESCRIPTION0' => $recurringDescriptionFull);
     $params = $urlParams + $recurring;
 } else {
     // Single payments
     $orderParams = array('PAYMENTREQUEST_0_AMT' => $price, 'PAYMENTREQUEST_0_SHIPPINGAMT' => '0', 'PAYMENTREQUEST_0_CURRENCYCODE' => $currencyCode, 'PAYMENTREQUEST_0_ITEMAMT' => $price);
     $itemParams = array('L_PAYMENTREQUEST_0_NAME0' => $paymentName, 'L_PAYMENTREQUEST_0_DESC0' => $paymentDescription, 'L_PAYMENTREQUEST_0_AMT0' => $price, 'L_PAYMENTREQUEST_0_QTY0' => '1');
     $params = $urlParams + $orderParams + $itemParams;
 }
 $response = $paypal->request('SetExpressCheckout', $params);
 $errors = new WP_Error();
 if (!$response) {
     $errorMessage = __('ERROR: Bad paypal API settings! Check paypal api credentials in admin settings!', 'ait');
     $detailErrorMessage = array_shift(array_values($paypal->getErrors()));
     $errors->add('bad_paypal_api', $errorMessage . ' ' . $detailErrorMessage);
     $registerErrors = $errors;
 }
 // Request successful
 if (is_array($response) && $response['ACK'] == 'Success') {
     // write token to DB
     $token = $response['TOKEN'];
     update_user_meta($userId, 'ait_dir_reg_paypal_token', $token);
     update_user_meta($userId, 'ait_dir_reg_paypal_role', $role);
     // write recurring data
     if (isset($aitThemeOptions->members->paypalPaymentType) && $aitThemeOptions->members->paypalPaymentType == 'recurring') {
开发者ID:kivivuori,项目名称:jotain,代码行数:31,代码来源:accounts-reg.php


注:本文中的Paypal::request方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。