订单摘要显示和付款摘要隐藏在PayPal适应性付款 [英] Order summary show and payment summary hide in paypal adaptive payment

查看:105
本文介绍了订单摘要显示和付款摘要隐藏在PayPal适应性付款的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试过这段代码,但这不适用于我,我需要这个快速结账和适应性付款,

我尝试了不同的方法,但添加了订单付款摘要和付款摘要在PayPal适应性付款不起作用

 函数Pay()
{
$ PayRequestFields =数组(
'ActionType'=>'PAY',//必需的。请求是否支付接收者或者请求是否设置为创建支付请求,但是直到ExecutePayment被调用才完成支付。值为:PAY,CREATE,PAY_PRIMARY
'CancelURL'=> site_url('paypal / adaptive_payments / pay_cancel'),//必需如果发件人取消对发件人的浏览器的批准,付款后paypal.com 1024字符最大
'货币Code'=>'AUD',//必需。 3个字符的货币代码。
'FeesPayer'=> 'EACHRECEIVER',//费用的付款人。值为:SENDER,PRIMARYRECEIVER,EACHRECEIVER,SECONDARYONLY
'IPNNotificationURL'=> '',//您希望发送此付款的所有IPN邮件的URL。最多1024个字符
'Memo'=> '',//与付款相关的注释(文本,而不是HTML)。最多1000个字符
'Pin'=> '',//发件人的个人身份证号码,当发件人申请预先批准时指定
'PreapprovalKey'=> '',//与此付款的预先批准相关的密钥。如果这是预先批准的付款,则需要预先批准。
'ReturnURL'=> site_url('paypal / adaptive_payments / pay_return'),//必填。在paypal.com上批准付款后,该订阅者的浏览器被重定向到的URL。最多1024个字符
'ReverseAllParallelPaymentsOnError'=> '',//如果付款发生错误,是否撤销平准付款。值为:TRUE,FALSE
'SenderEmail'=> '',//发件人的电子邮件地址。最多127个字符
'TrackingID'=> ''//您指定用于跟踪付款的唯一ID。最多127个字符
);

$ ClientDetailsFields = array(
'CustomerID'=>'',//您的发件人ID 127 char max。
'CustomerType'=>'', //您的客户类型的ID 127个最大值
'GeoLocation'=>'',//发件人的地理位置
'Model'=>''最多127个字符
'PartnerName'=>''//您的组织名称或ID
);

$ FundingTypes =数组('ECHECK','BALANCE','CREDITCARD');

$ Receivers = array();
$ Receiver = array(
'Amount'=>'25'
'Email'=>'a@b.com',
//接收者的电子邮件地址。最多127个字符
'InvoiceID'=>'',//付款的发票号码127 char max。
'PaymentType'=&';',//交易类型。 :'GOODS,SERVICE,PERSONAL,CASHADVANCE,DIGITALGOODS $ b'b'PaymentSubType'=>'',//付款的交易子类型
'Phone'=> array('CountryCode'=> '','PhoneNumber'=>'','Extension'=>''),//接收者的电话号码。主接收器,值为:TRUE,FALSE
);
array_push($ Receivers,$ Receiver);

$ Receiver = array(
'Amount'=>'10',
'说明'=>'asdfghj',
//必需金额
'Email'=>'b@c.com',
//收件人的电子邮件地址127 char max。
'InvoiceID'=>' ',//付款的发票号码127 char max。
'PaymentType'=>'',//交易类型值为:商品,服务,个人,CASHADVANCE,DIGITALGOODS
' PaymentSubType'=>'',//付款的交易子类型
'Phone'=> array('CountryCode'=&''','PhoneNumber'=&''','Extension' ="''),//接收者的电话号码e number。仅限数字
'Primary'=>''//此接收器是否是主接收器。值为:TRUE,FALSE
);
array_push($ Receivers,$ Receiver);
// print_r($ Receivers); die;



$ SenderIdentifierFields = array(
'UseCredentials'=>''//如果为TRUE,则使用凭据来标识发件人,默认为false。 b $ b);

$ AccountIdentifierFields = array(
'Email'=>'',//发件人的电子邮件地址127 char max。
'Phone'=> array('CountryCode '=>'','PhoneNumber'=>'','Extension'=>'')//发件人的电话号码,仅限数字
);

$ PayPalRequestData = array(
'PayRequestFields'=> $ PayRequestFields,$ b $'ClientDetailsFields'=> $ ClientDetailsFields,$ b $'FundingTypes'=> $ FundingTypes,
'Receivers'=> $ Receivers,
'SenderIdentifierFields'=> $ SenderIdentifierFields,
'AccountIdentifierFields'=> $ AccountIdentifierFields
);

$ PayPalResult = $ this-> paypal_adaptive-> Pay($ PayPalRequestData);
$ b $ if(!$ this-> paypal_adaptive-> APICallSuccessful($ PayPalResult ['Ack']))
{
$ errors = array('Errors'=> ; $ PayPalResult [ '错误']);
$ this-> load-> view('front / error',$ errors);
}
else
{
//成功拨打电话。加载视图或您需要在此处执行的任何操作。
echo'< pre />';
print_r($ PayPalResult);
echo'< p>< a href ='。$ PayPalResult ['RedirectURL']。'> PROCEED TO PAYPAL< / a>< / p>';


$ / code>


解决方案

Express

您可以使用快速结帐API并提供与进行API调用的API不同的PayPal卖家帐户ID(电子邮件)。这种配置允许在快速结账时进行并行付款(即使在重定向模式下),并且您可以控制订单总金额中的哪一部分用户购买。

并且通过快速结账,控制购物车的细节非常简单。

文档链接: https://developer.paypal.com/docs/classic/express-checkout/ht_ec-parallelPayments/


I have tried this code but this is not working for me, I need both of this express checkout and adaptive payment,

I have tried different methods but Add Order summary and payment summary on paypal adaptive payment not working

function Pay()
{
    $PayRequestFields = array(
                            'ActionType' => 'PAY',                              // Required.  Whether the request pays the receiver or whether the request is set up to create a payment request, but not fulfill the payment until the ExecutePayment is called.  Values are:  PAY, CREATE, PAY_PRIMARY
                            'CancelURL' => site_url('paypal/adaptive_payments/pay_cancel'),                                     // Required.  The URL to which the sender's browser is redirected if the sender cancels the approval for the payment after logging in to paypal.com.  1024 char max.
                            'CurrencyCode' => 'AUD',                                // Required.  3 character currency code.
                            'FeesPayer' => 'EACHRECEIVER',                                  // The payer of the fees.  Values are:  SENDER, PRIMARYRECEIVER, EACHRECEIVER, SECONDARYONLY
                            'IPNNotificationURL' => '',                         // The URL to which you want all IPN messages for this payment to be sent.  1024 char max.
                            'Memo' => '',                                       // A note associated with the payment (text, not HTML).  1000 char max
                            'Pin' => '',                                        // The sener's personal id number, which was specified when the sender signed up for the preapproval
                            'PreapprovalKey' => '',                             // The key associated with a preapproval for this payment.  The preapproval is required if this is a preapproved payment.  
                            'ReturnURL' => site_url('paypal/adaptive_payments/pay_return'),                                     // Required.  The URL to which the sener's browser is redirected after approvaing a payment on paypal.com.  1024 char max.
                            'ReverseAllParallelPaymentsOnError' => '',          // Whether to reverse paralel payments if an error occurs with a payment.  Values are:  TRUE, FALSE
                            'SenderEmail' => '',                                // Sender's email address.  127 char max.
                            'TrackingID' => ''                                  // Unique ID that you specify to track the payment.  127 char max.
                            );

    $ClientDetailsFields = array(
                            'CustomerID' => '',                                 // Your ID for the sender  127 char max.
                            'CustomerType' => '',                               // Your ID of the type of customer.  127 char max.
                            'GeoLocation' => '',                                // Sender's geographic location
                            'Model' => '',                                      // A sub-identification of the application.  127 char max.
                            'PartnerName' => ''                                 // Your organization's name or ID
                            );

    $FundingTypes = array('ECHECK', 'BALANCE', 'CREDITCARD');

    $Receivers = array();
    $Receiver = array(
                    'Amount' => '25'
                    'Email' => 'a@b.com', 
                    // Receiver's email address. 127 char max.
                    'InvoiceID' => '',                                          // The invoice number for the payment.  127 char max.
                    'PaymentType' => '',                                        // Transaction type.  Values are:  GOODS, SERVICE, PERSONAL, CASHADVANCE, DIGITALGOODS
                    'PaymentSubType' => '',                                     // The transaction subtype for the payment.
                    'Phone' => array('CountryCode' => '', 'PhoneNumber' => '', 'Extension' => ''), // Receiver's phone number.   Numbers only.
                    'Primary' => ''                                             // Whether this receiver is the primary receiver.  Values are:  TRUE, FALSE
                    );
    array_push($Receivers,$Receiver);

    $Receiver = array(
                    'Amount' => '10',       
                    'Description' => 'asdfghj', 
                    // Required.  Amount to be paid to the receiver.
                    'Email' => 'b@c.com', 
                    // Receiver's email address. 127 char max.
                    'InvoiceID' => '',                                          // The invoice number for the payment.  127 char max.
                    'PaymentType' => '',                                        // Transaction type.  Values are:  GOODS, SERVICE, PERSONAL, CASHADVANCE, DIGITALGOODS
                    'PaymentSubType' => '',                                     // The transaction subtype for the payment.
                    'Phone' => array('CountryCode' => '', 'PhoneNumber' => '', 'Extension' => ''), // Receiver's phone number.   Numbers only.
                    'Primary' => ''                                             // Whether this receiver is the primary receiver.  Values are:  TRUE, FALSE
                    );
    array_push($Receivers,$Receiver);
    //print_r($Receivers);die;



    $SenderIdentifierFields = array(
                                    'UseCredentials' => ''                      // If TRUE, use credentials to identify the sender.  Default is false.
                                    );

    $AccountIdentifierFields = array(
                                    'Email' => '',                              // Sender's email address.  127 char max.
                                    'Phone' => array('CountryCode' => '', 'PhoneNumber' => '', 'Extension' => '')                               // Sender's phone number.  Numbers only.
                                    );

    $PayPalRequestData = array(
                        'PayRequestFields' => $PayRequestFields, 
                        'ClientDetailsFields' => $ClientDetailsFields, 
                        'FundingTypes' => $FundingTypes, 
                        'Receivers' => $Receivers, 
                        'SenderIdentifierFields' => $SenderIdentifierFields, 
                        'AccountIdentifierFields' => $AccountIdentifierFields
                        );  

    $PayPalResult = $this->paypal_adaptive->Pay($PayPalRequestData);

    if(!$this->paypal_adaptive->APICallSuccessful($PayPalResult['Ack']))
    {
        $errors = array('Errors'=>$PayPalResult['Errors']);
        $this->load->view('front/error',$errors);
    }
    else
    {
        // Successful call.  Load view or whatever you need to do here. 
        echo '<pre />';
        print_r($PayPalResult);
        echo '<p><a href="' . $PayPalResult['RedirectURL'] . '">PROCEED TO PAYPAL</a></p>';
    }
}

解决方案

Express checkout is not use the adaptive payment library.

You can use the express checkout API and provide a paypal seller account id (email) different from the one making the API call. This configuration allow parallel payment in express checkout (even in redirect mode) and you can controll to which user part of the total amount of the order go.

And with express checkout, controlling the cart detail is very easy.

A link to the documentation : https://developer.paypal.com/docs/classic/express-checkout/ht_ec-parallelPayments/

这篇关于订单摘要显示和付款摘要隐藏在PayPal适应性付款的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆