本文整理汇总了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>';