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


PHP Paypal::processDGPayment方法代碼示例

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


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

示例1: urldecode

     $ENDPOINT = 'https://api-3t.sandbox.paypal.com/nvp';
 }
 $VERSION = '65.1';
 //must be >= 65.1
 //Build the Credential String:
 $cred_str = 'USER=' . $APIUSERNAME . '&PWD=' . $APIPASSWORD . '&SIGNATURE=' . $APISIGNATURE . '&VERSION=' . $VERSION;
 //Build NVP String for GetExpressCheckoutDetails
 $nvp_str = '&METHOD=GetExpressCheckoutDetails&TOKEN=' . urldecode($token);
 //combine the two strings and make the API Call
 $req_str = $cred_str . $nvp_str;
 $response = Paypal::httpPost($ENDPOINT, $req_str);
 //based on the API Response from GetExpressCheckoutDetails
 $doec_str = $cred_str . '&METHOD=DoExpressCheckoutPayment' . '&TOKEN=' . $token . '&PAYERID=' . $payerid . '&PAYMENTREQUEST_0_CURRENCYCODE=' . urldecode($response['PAYMENTREQUEST_0_CURRENCYCODE']) . '&PAYMENTREQUEST_0_AMT=' . urldecode($response['PAYMENTREQUEST_0_AMT']) . '&PAYMENTREQUEST_0_ITEMAMT=' . urldecode($response['PAYMENTREQUEST_0_ITEMAMT']) . '&PAYMENTREQUEST_0_TAXAMT=' . urldecode($response['PAYMENTREQUEST_0_TAXAMT']) . '&PAYMENTREQUEST_0_DESC=' . urldecode($response['PAYMENTREQUEST_0_DESC']) . '&PAYMENTREQUEST_0_PAYMENTACTION=Sale' . '&L_PAYMENTREQUEST_0_ITEMCATEGORY0=' . urldecode($response['L_PAYMENTREQUEST_0_ITEMCATEGORY0']) . '&L_PAYMENTREQUEST_0_NAME0=' . urldecode($response['L_PAYMENTREQUEST_0_NAME0']) . '&L_PAYMENTREQUEST_0_NUMBER0=' . urldecode($response['L_PAYMENTREQUEST_0_NUMBER0']) . '&L_PAYMENTREQUEST_0_QTY0=' . urldecode($response['L_PAYMENTREQUEST_0_QTY0']) . '&L_PAYMENTREQUEST_0_TAXAMT0=' . urldecode($response['L_PAYMENTREQUEST_0_TAXAMT0']) . '&L_PAYMENTREQUEST_0_AMT0=' . urldecode($response['L_PAYMENTREQUEST_0_AMT0']) . '&L_PAYMENTREQUEST_0_DESC0=' . urldecode($response['L_PAYMENTREQUEST_0_DESC0']) . '&NOTIFYURL=';
 //make the DoEC Call:
 $doresponse = Paypal::httpPost($ENDPOINT, $doec_str);
 $status = Paypal::processDGPayment($doresponse, $response);
 $product_type = explode('x', urldecode($response['L_PAYMENTREQUEST_0_NUMBER0']));
 if ($status == PAYMENT_COMPLETED || $status == PAYMENT_ALREADY_PAID) {
     osc_add_flash_ok_message(__('Payment processed correctly', 'payment'));
     if ($product_type[0] == '101') {
         $item = Item::newInstance()->findByPrimaryKey($product_type[2]);
         $category = Category::newInstance()->findByPrimaryKey($item['fk_i_category_id']);
         View::newInstance()->_exportVariableToView('category', $category);
         $html = '<p>' . __('Payment processed correctly', 'payment') . ' <a href=\\"' . osc_search_category_url() . '\\">' . __('Click here to continue', 'payment') . '</a></p>';
         $url = osc_search_category_url();
     } else {
         if ($product_type[0] == '201') {
             $html = '<p>' . __('Payment processed correctly', 'payment') . ' <a href=\\"' . payment_js_redirect_to(osc_route_url('payment-user-menu')) . '\\">' . __("Click here to continue", 'payment') . '</a></p>';
             $url = payment_js_redirect_to(osc_route_url('payment-user-menu'));
         } else {
             $html = '<p>' . __('Payment processed correctly', 'payment') . ' <a href=\\"' . payment_js_redirect_to(osc_route_url('payment-user-pack')) . '\\">' . __("Click here to continue", 'payment') . '</a></p>';
開發者ID:virsoni,項目名稱:plugin-payment,代碼行數:31,代碼來源:return.php


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