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


PHP hash_call函数代码示例

本文整理汇总了PHP中hash_call函数的典型用法代码示例。如果您正苦于以下问题:PHP hash_call函数的具体用法?PHP hash_call怎么用?PHP hash_call使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: call_masspay_api

 /**
  * Init payPal Mass pay api
  */
 public function call_masspay_api($receiver_information)
 {
     global $WCMp;
     require_once $WCMp->plugin_path . 'lib/paypal/CallerService.php';
     session_start();
     $emailSubject = urlencode('You have money!');
     $receiverType = urlencode('EmailAddress');
     $currency = urlencode(get_woocommerce_currency());
     $nvpstr = '';
     if ($receiver_information) {
         foreach ($receiver_information as $receiver) {
             $j = 0;
             $receiverEmail = urlencode($receiver['recipient']);
             $amount = urlencode($receiver['total']);
             $uniqueID = urlencode($receiver['vendor_id']);
             $note = urlencode($receiver['payout_note']);
             $nvpstr .= "&L_EMAIL{$j}={$receiverEmail}&L_Amt{$j}={$amount}&L_UNIQUEID{$j}={$uniqueID}&L_NOTE{$j}={$note}";
             $j++;
         }
         $nvpstr .= "&EMAILSUBJECT={$emailSubject}&RECEIVERTYPE={$receiverType}&CURRENCYCODE={$currency}";
         doProductVendorLOG($nvpstr);
         $resArray = hash_call("MassPay", $nvpstr);
         $ack = strtoupper($resArray["ACK"]);
         if ($ack == "SUCCESS" || $ack == "SuccessWithWarning") {
             doProductVendorLOG(json_encode($resArray));
             return $resArray;
         } else {
             doProductVendorLOG(json_encode($resArray));
             return false;
         }
     }
     return false;
 }
开发者ID:qhuit,项目名称:UrbanPekor,代码行数:36,代码来源:class-wcmp-paypal-masspay.php

示例2: do_nvp_call

 function do_nvp_call($nvpstr)
 {
     global $db;
     $APIUsername = $this->config['api_user'];
     $APISignature = $this->config['api_sig'];
     $APIPassword = $this->config['api_pass'];
     if ($this->config['testing']) {
         $API_Endpoint = 'https://api-3t.sandbox.paypal.com/nvp';
     } else {
         $API_Endpoint = 'https://api-aa-3t.paypal.com/nvp';
     }
     $resArray = hash_call("doDirectPayment", $nvpstr, $APIUsername, $APIPassword, $APISignature, $API_Endpoint);
     return $resArray;
 }
开发者ID:subashemphasize,项目名称:test_site,代码行数:14,代码来源:paypal_nvp.inc.php

示例3: transaction

 /**
  * Makes the paypal transacation
  *
  * @param Array $fields
  * @return boolean
  */
 public function transaction($fields)
 {
     /* Construct the request string that will be sent to PayPal.
        The variable $nvpstr contains all the variables and is a
        name value pair string with & as a delimiter */
     $nvpstr = "&PAYMENTACTION={$fields['paymentType']}&AMT={$fields['amount']}&CREDITCARDTYPE={$fields['creditCardType']}&ACCT={$fields['creditCardNumber']}&EXPDATE=" . $fields['expDateMonth'] . $fields['expDateYear'] . "&CVV2={$fields['cvv2Number']}&FIRSTNAME={$fields['firstName']}&LASTNAME={$fields['lastName']}&" . "STREET={$fields['address1']}&CITY={$fields['city']}&STATE={$fields['state']}" . "&ZIP={$fields['zip']}&COUNTRYCODE={$fields['country']}&CURRENCYCODE={$fields['currencyCode']}";
     /* Make the API call to PayPal, using API signature.
        The API response is stored in an associative array called $resArray */
     /* @var $resArray type */
     $this->resArray = hash_call("doDirectPayment", $nvpstr);
     /* Display the API response back to the browser.
        If the response from PayPal was a success, display the response parameters'
        If the response was an error, display the errors received using APIError.php.
        */
     $ack = strtoupper($this->resArray["ACK"]);
     if ($ack == "SUCCESS" || $ack == "SUCCESSWITHWARNING") {
         return true;
     } else {
         return false;
     }
 }
开发者ID:hbarroso,项目名称:Goworkat,代码行数:27,代码来源:payment.php

示例4: ConfirmPayment

function ConfirmPayment($token, $paymentType, $currencyCodeType, $payerID, $FinalPaymentAmt, $items)
{
    /* Gather the information to make the final call to
       finalize the PayPal payment.  The variable nvpstr
       holds the name value pairs
       */
    $token = urlencode($token);
    $paymentType = urlencode($paymentType);
    $currencyCodeType = urlencode($currencyCodeType);
    $payerID = urlencode($payerID);
    $serverName = urlencode($_SERVER['SERVER_NAME']);
    $nvpstr = '&TOKEN=' . $token . '&PAYERID=' . $payerID . '&PAYMENTREQUEST_0_PAYMENTACTION=' . $paymentType . '&PAYMENTREQUEST_0_AMT=' . $FinalPaymentAmt;
    $nvpstr .= '&PAYMENTREQUEST_0_CURRENCYCODE=' . $currencyCodeType . '&IPADDRESS=' . $serverName;
    foreach ($items as $index => $item) {
        $nvpstr .= "&L_PAYMENTREQUEST_0_NAME" . $index . "=" . urlencode($item["name"]);
        $nvpstr .= "&L_PAYMENTREQUEST_0_AMT" . $index . "=" . urlencode($item["amt"]);
        $nvpstr .= "&L_PAYMENTREQUEST_0_QTY" . $index . "=" . urlencode($item["qty"]);
        $nvpstr .= "&L_PAYMENTREQUEST_0_ITEMCATEGORY" . $index . "=Digital";
    }
    /* Make the call to PayPal to finalize payment
       If an error occured, show the resulting errors
       */
    $resArray = hash_call("DoExpressCheckoutPayment", $nvpstr);
    /* Display the API response back to the browser.
       If the response from PayPal was a success, display the response parameters'
       If the response was an error, display the errors received using APIError.php.
       */
    $ack = strtoupper($resArray["ACK"]);
    return $resArray;
}
开发者ID:vodaben,项目名称:monopoly,代码行数:30,代码来源:paypalfunctions.php

示例5: header

        header("Location: {$location}");
    }
} else {
    /* At this point, the buyer has completed in authorizing payment
    			at PayPal.  The script will now call PayPal with the details
    			of the authorization, incuding any shipping information of the
    			buyer.  Remember, the authorization is not a completed transaction
    			at this state - the buyer still needs an additional step to finalize
    			the transaction
    			*/
    $token = urlencode($_REQUEST['token']);
    /* Build a second API request to PayPal, using the token as the
    			ID to get the details on the payment authorization
    			*/
    $nvpstr = "&TOKEN=" . $token;
    $nvpstr = $nvpHeader . $nvpstr;
    /* Make the API call and store the results in an array.  If the
    			call was a success, show the authorization details, and provide
    			an action to complete the payment.  If failed, show the error
    			*/
    $resArray = hash_call("GetExpressCheckoutDetails", $nvpstr);
    $_SESSION['reshash'] = $resArray;
    $ack = strtoupper($resArray["ACK"]);
    if ($ack == 'SUCCESS' || $ack == 'SUCCESSWITHWARNING') {
        require_once "GetExpressCheckoutDetails.php";
    } else {
        //Redirecting to APIError.php to display errors.
        $location = "APIError.php";
        header("Location: {$location}");
    }
}
开发者ID:rezamoussavi,项目名称:MouRe,代码行数:31,代码来源:ReviewOrder.php

示例6: urlencode

$creditCardType = urlencode($_POST['creditCardType']);
$creditCardNumber = urlencode($_POST['creditCardNumber']);
$expDateMonth = urlencode($_POST['expDateMonth']);
//Month must be padded with leading zero
$padDateMonth = str_pad($expDateMonth, 2, '0', STR_PAD_LEFT);
$expDateYear = urlencode($_POST['expDateYear']);
$cvv2Number = urlencode($_POST['cvv2Number']);
$amount = urlencode($_POST['ftotal']);
$currencyCode = "USD";
/* Construct the request string that will be sent to PayPal.
   The variable $nvpstr contains all the variables and is a
   name value pair string with & as a delimiter */
$nvpstr = "&PAYMENTACTION={$paymentType}&AMT={$amount}&CREDITCARDTYPE={$creditCardType}&ACCT={$creditCardNumber}&EXPDATE=" . $padDateMonth . $expDateYear . "&CVV2={$cvv2Number}&FIRSTNAME={$firstName}&COUNTRYCODE=US&CURRENCYCODE={$currencyCode}";
/* Make the API call to PayPal, using API signature.
   The API response is stored in an associative array called $resArray */
$resArray = hash_call("doDirectPayment", $nvpstr);
/* Display the API response back to the browser.
   If the response from PayPal was a success, display the response parameters'
   If the response was an error, display the errors received using APIError.php.
*/
$ack = strtoupper($resArray["ACK"]);
if ($ack != "SUCCESS") {
    $_SESSION['reshash'] = $resArray;
    $location = "confirmation.php?flag=2";
    header("Location: {$location}");
}
if ($ack == "SUCCESS") {
    $_SESSION['reshash'] = "SUCCESS";
    $location = "thankyou.php?stage=3";
    header("Location: {$location}");
}
开发者ID:beyondkeysystem,项目名称:testone,代码行数:31,代码来源:paypal_entry.php

示例7: DirectPayment

function DirectPayment($paymentType, $paymentAmount, $creditCardType, $creditCardNumber, $expDate, $cvv2, $firstName, $lastName, $street, $city, $state, $zip, $countryCode, $currencyCode)
{
    //Construct the parameter string that describes DoDirectPayment
    $nvpstr = "&AMT=" . $paymentAmount;
    $nvpstr = $nvpstr . "&CURRENCYCODE=" . $currencyCode;
    $nvpstr = $nvpstr . "&PAYMENTACTION=" . $paymentType;
    $nvpstr = $nvpstr . "&CREDITCARDTYPE=" . $creditCardType;
    $nvpstr = $nvpstr . "&ACCT=" . $creditCardNumber;
    $nvpstr = $nvpstr . "&EXPDATE=" . $expDate;
    $nvpstr = $nvpstr . "&CVV2=" . $cvv2;
    $nvpstr = $nvpstr . "&FIRSTNAME=" . $firstName;
    $nvpstr = $nvpstr . "&LASTNAME=" . $lastName;
    $nvpstr = $nvpstr . "&STREET=" . $street;
    $nvpstr = $nvpstr . "&CITY=" . $city;
    $nvpstr = $nvpstr . "&STATE=" . $state;
    $nvpstr = $nvpstr . "&COUNTRYCODE=" . $countryCode;
    $nvpstr = $nvpstr . "&IPADDRESS=" . $_SERVER['REMOTE_ADDR'];
    $resArray = hash_call("DoDirectPayment", $nvpstr);
    return $resArray;
}
开发者ID:hasmi93,项目名称:dopbs,代码行数:20,代码来源:paypalfunctions.php

示例8: session_start

session_start();
/* Gather the information to make the final call to
   finalize the PayPal payment.  The variable nvpstr
   holds the name value pairs
   */
$token = urlencode($_SESSION['token']);
$paymentAmount = urlencode($_SESSION['paymentAmount']);
$paymentType = urlencode($_SESSION['paymentType']);
$currCodeType = urlencode($_SESSION['currCodeType']);
$payerID = urlencode($_SESSION['payer_id']);
$serverName = urlencode($_SERVER['SERVER_NAME']);
$nvpstr = '&TOKEN=' . $token . '&PAYERID=' . $payerID . '&PAYMENTACTION=' . $paymentType . '&AMT=' . $paymentAmount . '&CURRENCYCODE=' . $currCodeType . '&IPADDRESS=' . $serverName;
/* Make the call to PayPal to finalize payment
   If an error occured, show the resulting errors
   */
$resArray = hash_call("DoExpressCheckoutPayment", $nvpstr);
/* Display the API response back to the browser.
   If the response from PayPal was a success, display the response parameters'
   If the response was an error, display the errors received using APIError.php.
   */
$ack = strtoupper($resArray["ACK"]);
if ($ack != "SUCCESS") {
    $_SESSION['reshash'] = $resArray;
    $location = "APIError.php";
    header("Location: {$location}");
}
?>


<html>
<head>
开发者ID:ericmuyser,项目名称:web2f,代码行数:31,代码来源:DoExpressCheckoutPayment.php

示例9: confirmPayment

/**
 *	Validate payment
 *
 *	@param	string	$token				Token
 *	@param	string	$paymentType		Type
 *	@param	string	$currencyCodeType	Currency
 *	@param	string	$payerID			Payer ID
 *	@param	string	$ipaddress			IP Address
 *	@param	string	$FinalPaymentAmt	Amount
 *	@param	string	$tag				Tag
 *	@return	void
 */
function confirmPayment($token, $paymentType, $currencyCodeType, $payerID, $ipaddress, $FinalPaymentAmt, $tag)
{
    /* Gather the information to make the final call to
       finalize the PayPal payment.  The variable nvpstr
       holds the name value pairs
       */
    //declaring of global variables
    global $conf, $langs;
    global $API_Endpoint, $API_Url, $API_version, $USE_PROXY, $PROXY_HOST, $PROXY_PORT;
    global $PAYPAL_API_USER, $PAYPAL_API_PASSWORD, $PAYPAL_API_SIGNATURE;
    $nvpstr = '';
    $nvpstr .= '&TOKEN=' . urlencode($token);
    $nvpstr .= '&PAYERID=' . urlencode($payerID);
    $nvpstr .= '&PAYMENTACTION=' . urlencode($paymentType);
    $nvpstr .= '&AMT=' . urlencode($FinalPaymentAmt);
    $nvpstr .= '&CURRENCYCODE=' . urlencode($currencyCodeType);
    $nvpstr .= '&IPADDRESS=' . urlencode($ipaddress);
    $nvpstr .= '&INVNUM=' . urlencode($tag);
    /* Make the call to PayPal to finalize payment
       If an error occured, show the resulting errors
       */
    $resArray = hash_call("DoExpressCheckoutPayment", $nvpstr);
    /* Display the API response back to the browser.
       If the response from PayPal was a success, display the response parameters'
       If the response was an error, display the errors received using APIError.php.
       */
    $ack = strtoupper($resArray["ACK"]);
    return $resArray;
}
开发者ID:TAASA,项目名称:Dolibarr-ERP-3.8.1,代码行数:41,代码来源:paypal.lib.php

示例10: __Cart


//.........这里部分代码省略.........
new Spry.Widget.ValidationSelect("spryselect3", {validateOn:["blur", "change"], invalidValue:""});
new Spry.Widget.ValidationSelect("spryselect4", {validateOn:["blur", "change"], invalidValue:""});
new Spry.Widget.ValidationTextField("sprytextfield10", "none", {validateOn:["blur", "change"]});
new Spry.Widget.ValidationTextField("sprytextfield11", "none", {validateOn:["blur", "change"]});
new Spry.Widget.ValidationTextField("sprytextfield12", "zip_code", {validateOn:["blur"]});
new Spry.Widget.ValidationTextField("sprytextfield13", "phone_number", {validateOn:["blur"], useCharacterMasking:true});
//-->
</script>

EOH;
                break;
            case "complete":
                if ($settings['require_authorization'] && !$this->User->Validated) {
                    $this->Redirect($this->Site->URL . "/account/login/");
                }
                $type = $this->Session['type'];
                if ($type == "pp_express") {
                    require_once PATH . "/libs/paypal/constants.php";
                    require_once PATH . "/libs/paypal/CallerService.php";
                    /* Gather the information to make the final call to
                       finalize the PayPal payment.  The variable nvpstr
                       holds the name value pairs
                       */
                    $token = urlencode($this->Session['token']);
                    $paymentAmount = urlencode($this->Session['amount']);
                    $paymentType = urlencode($this->Session['paymentType']);
                    $currCodeType = urlencode($this->Session['currCodeType']);
                    $payerID = urlencode($this->Session['payer_id']);
                    $serverName = urlencode($this->Session['SERVER_NAME']);
                    $nvpstr = '&TOKEN=' . $token . '&PAYERID=' . $payerID . '&PAYMENTACTION=' . $paymentType . '&AMT=' . $paymentAmount . '&CURRENCYCODE=' . $currCodeType . '&IPADDRESS=' . $serverName;
                    /* Make the call to PayPal to finalize payment
                       If an error occured, show the resulting errors
                       */
                    $resArray = hash_call("DoExpressCheckoutPayment", $nvpstr);
                    /* Display the API response back to the browser.
                       If the response from PayPal was a success, display the response parameters'
                       If the response was an error, display the errors received using APIError.php.
                       */
                    $ack = strtoupper($resArray["ACK"]);
                    if ($ack == "SUCCESS") {
                        $query = array();
                        $query[] = "`order_amount` = '" . $resArray['AMT'] . "'";
                        if ($this->Session['order_products']) {
                            $query[] = "`order_products` = '" . rawurldecode($this->Session['order_products']) . "'";
                        }
                        if ($currCodeType) {
                            $query[] = "`order_currency` = '" . $currCodeType . "'";
                        }
                        if ($resArray['TRANSACTIONID']) {
                            $query[] = "`order_transaction_id` = '" . $resArray['TRANSACTIONID'] . "'";
                        }
                        $query[] = "`shipping_first_name` = '" . mysql_real_escape_string(rawurldecode($this->Session['shipping_first_name'])) . "'";
                        $query[] = "`shipping_last_name` = '" . mysql_real_escape_string(rawurldecode($this->Session['shipping_last_name'])) . "'";
                        $query[] = "`shipping_street_1` = '" . mysql_real_escape_string(rawurldecode($this->Session['shipping_street_1'])) . "'";
                        $query[] = "`shipping_street_2` = '" . mysql_real_escape_string(rawurldecode($this->Session['shipping_street_2'])) . "'";
                        $query[] = "`shipping_city` = '" . mysql_real_escape_string(rawurldecode($this->Session['shipping_city'])) . "'";
                        $query[] = "`shipping_state` = '" . mysql_real_escape_string(rawurldecode($this->Session['shipping_state'])) . "'";
                        $query[] = "`shipping_postal_code` = '" . mysql_real_escape_string(rawurldecode($this->Session['shipping_postal_code'])) . "'";
                        $query[] = "`shipping_phone_number` = '" . mysql_real_escape_string(rawurldecode($this->Session['shipping_phone_number'])) . "'";
                        $query[] = "`shipping_fax_number` = '" . mysql_real_escape_string(rawurldecode($this->Session['shipping_fax_number'])) . "'";
                        $query[] = "`shipping_country` = '" . mysql_real_escape_string(rawurldecode($this->Session['shipping_country'])) . "'";
                        $query[] = "`billing_first_name` = '" . mysql_real_escape_string(rawurldecode($this->Session['billing_first_name'])) . "'";
                        $query[] = "`billing_last_name` = '" . mysql_real_escape_string(rawurldecode($this->Session['billing_last_name'])) . "'";
                        $query[] = "`billing_street_1` = '" . mysql_real_escape_string(rawurldecode($this->Session['billing_street_1'])) . "'";
                        $query[] = "`billing_street_2` = '" . mysql_real_escape_string(rawurldecode($this->Session['billing_street_2'])) . "'";
                        $query[] = "`billing_city` = '" . mysql_real_escape_string(rawurldecode($this->Session['billing_city'])) . "'";
开发者ID:ericmuyser,项目名称:web2f,代码行数:67,代码来源:eCommerce.php

示例11: session_unset

Calls CallerService.php and APIError.php.

******************************************************/
// clearing the session before starting new API Call
session_unset();
require_once '../CallerService.php';
session_start();
$profileID = urlencode($_REQUEST['profileID']);
$action = urlencode($_REQUEST['action']);
/* Construct the request string that will be sent to PayPal.
   The variable $nvpstr contains all the variables and is a
   name value pair string with & as a delimiter */
$nvpStr = "&PROFILEID={$profileID}&ACTION={$action}";
/* Make the API call to PayPal, using API signature.
   The API response is stored in an associative array called $resArray */
$resArray = hash_call("ManageRecurringPaymentsProfileStatus", $nvpStr);
/* Next, collect the API request in the associative array $reqArray
   as well to display back to the browser.
   Normally you wouldnt not need to do this, but its shown for testing */
$reqArray = $_SESSION['nvpReqArray'];
/* Display the API response back to the browser.
   If the response from PayPal was a success, display the response parameters'
   If the response was an error, display the errors received using APIError.php.
   */
$ack = strtoupper($resArray["ACK"]);
if ($ack != "SUCCESS") {
    $_SESSION['reshash'] = $resArray;
    $location = "../APIError.php";
    header("Location: {$location}");
}
?>
开发者ID:stamhe,项目名称:Paypal-NVP-PHP-code-examples,代码行数:31,代码来源:ManageRPProfileStatus.php

示例12: session_unset

Calls CallerService.php and APIError.php.

******************************************************/
// clearing the session before starting new API Call
session_unset();
require_once '../CallerService.php';
session_start();
$profileID = urlencode($_REQUEST['profileID']);
/* Construct the request string that will be sent to PayPal.
   The variable $nvpstr contains all the variables and is a
   name value pair string with & as a delimiter */
$nvpStr = "&PROFILEID={$profileID}";
/* Make the API call to PayPal, using API signature.
   The API response is stored in an associative array called $resArray */
$resArray = hash_call("GetRecurringPaymentsProfileDetails", $nvpStr);
/* Next, collect the API request in the associative array $reqArray
   as well to display back to the browser.
   Normally you wouldnt not need to do this, but its shown for testing */
$reqArray = $_SESSION['nvpReqArray'];
/* Display the API response back to the browser.
   If the response from PayPal was a success, display the response parameters'
   If the response was an error, display the errors received using APIError.php.
   */
$ack = strtoupper($resArray["ACK"]);
if ($ack != "SUCCESS") {
    $_SESSION['reshash'] = $resArray;
    $location = "../APIError.php";
    header("Location: {$location}");
}
?>
开发者ID:Sibzsolutions,项目名称:Savostore,代码行数:30,代码来源:GetRPProfileDetails.php

示例13: MassPayment

/**
 * Purpose: 	This function makes a MassPay API call
 * Inputs:
 *		Beneficiarie:		Array that contains the Beneficiearie paypal account and the payout amount
 *		Currency Code:  	The currency Iso code
 * Returns:
 *		The NVP Collection object of the MassPay Call Response.
 */
function MassPayment(array $beneficiaries, $currencyCode)
{
    $nvpstr = "&RECEIVERTYPE=EmailAddress";
    $nvpstr .= "&CURRENCYCODE=" . $currencyCode;
    $index = 0;
    foreach ($beneficiaries as $beneficiary) {
        $nvpstr .= "&L_EMAIL" . $index . "=" . $beneficiary['paypal_account'];
        $nvpstr .= "&L_AMT" . $index . "=" . $beneficiary['commission'];
        $index++;
    }
    $resArray = hash_call("MassPay", $nvpstr);
    return $resArray;
}
开发者ID:omaoibrahim,项目名称:chamilo-lms,代码行数:21,代码来源:paypalfunctions.php

示例14: ConfirmPayment

function ConfirmPayment($FinalPaymentAmt)
{
    /* Gather the information to make the final call to
       finalize the PayPal payment.  The variable nvpstr
       holds the name value pairs
       */
    //Format the other parameters that were stored in the session from the previous calls
    $token = urlencode($_SESSION['token']);
    $paymentType = urlencode($_SESSION['paymentType']);
    $currencyCodeType = urlencode($_SESSION['currencyCodeType']);
    $payerID = urlencode($_SESSION['payer_id']);
    $serverName = urlencode($_SERVER['SERVER_NAME']);
    $nvpstr = '&TOKEN=' . $token . '&PAYERID=' . $payerID . '&PAYMENTACTION=' . $paymentType . '&AMT=' . $FinalPaymentAmt;
    $nvpstr .= '&CURRENCYCODE=' . $currencyCodeType . '&IPADDRESS=' . $serverName;
    /* Make the call to PayPal to finalize payment
       If an error occured, show the resulting errors
       */
    $resArray = hash_call("DoExpressCheckoutPayment", $nvpstr);
    /* Display the API response back to the browser.
       If the response from PayPal was a success, display the response parameters'
       If the response was an error, display the errors received using APIError.php.
       */
    $ack = strtoupper($resArray["ACK"]);
    return $resArray;
}
开发者ID:papayalabs,项目名称:htdocs,代码行数:25,代码来源:paypal_certified.php

示例15: finishAction


//.........这里部分代码省略.........
              * Fist name, last name
              */
             $firstName = trim(substr($data['full_name'], 0, strpos($data['full_name'] . ' ', ' ') + 1));
             $lastName = trim(substr($data['full_name'], strlen($firstName)));
             /**
              * Get required parameters from the web form for the request
              */
             $paymentType = urlencode('Sale');
             $firstName = urlencode($firstName);
             $lastName = urlencode($lastName);
             $creditCardType = urlencode($data['card_type']);
             $creditCardNumber = urlencode($data['card_number']);
             $expDateMonth = urlencode($data['card_month']);
             // Month must be padded with leading zero
             $padDateMonth = str_pad($expDateMonth, 2, '0', STR_PAD_LEFT);
             $expDateYear = urlencode($data['card_year']);
             $cvv2Number = urlencode($data['card_cvv']);
             $address1 = urlencode($data['address']);
             $address2 = urlencode('');
             $city = urlencode($data['city']);
             $state = urlencode($data['state']);
             $zip = urlencode($data['zip_code']);
             $amount = urlencode(number_format($res['reser_deposit'], 2, '.', ''));
             $currencyCode = "CAD";
             //            $state = 'NL';
             $country = 'CA';
             /* Construct the request string that will be sent to PayPal.
                The variable $nvpstr contains all the variables and is a
                name value pair string with & as a delimiter */
             $nvpstr = "&PAYMENTACTION={$paymentType}&AMT={$amount}&CREDITCARDTYPE={$creditCardType}&ACCT={$creditCardNumber}&EXPDATE=" . $padDateMonth . $expDateYear . "&CVV2={$cvv2Number}&FIRSTNAME={$firstName}&LASTNAME={$lastName}&STREET={$address1}&CITY={$city}&STATE={$state}" . "&ZIP={$zip}&COUNTRYCODE={$country}&CURRENCYCODE={$currencyCode}";
             //            echo $nvpstr;die;
             /* Make the API call to PayPal, using API signature.
                The API response is stored in an associative array called $resArray */
             $resArray = hash_call("doDirectPayment", $nvpstr);
             //            echo '<pre>';print_r($resArray);die;
             /* Display the API response back to the browser.
                If the response from PayPal was a success, display the response parameters'
                If the response was an error, display the errors received using APIError.php.
                */
             $ack = strtoupper($resArray["ACK"]);
             /**
              * End payment
              **************************************************************************/
         }
         if ('1' == $res['reser_deposit_onoff'] && $ack != "SUCCESS") {
             $error = @$resArray['L_LONGMESSAGE0'];
             /**
              * Delete reservation
              */
             $objReser->delete(array('reservation_id=?' => $newReserId));
         } else {
             /**
              * Success
              */
             /**
              * Send email to admin and user
              */
             $objUser = new Models_User();
             $objMail = new Models_Mail();
             $config = Vi_Registry::getConfig();
             $cardNumber = @$data['card_number'];
             $cardNumber[4] = 'X';
             $cardNumber[5] = 'X';
             $cardNumber[6] = 'X';
             $cardNumber[7] = 'X';
             $cardNumber[8] = 'X';
开发者ID:judasnow,项目名称:qspread20101020,代码行数:67,代码来源:ReservationController.php


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