下午好
我正在将贝宝与巴西 Magento 平台集成,我必须获得贝宝退回的费用
//---------//routine to recover the fee on database Paypal//--------//
$nvp = array(
//'TRANSACTIONID' => '7W763566L0166562G',
'TRANSACTIONID' => $transactionId,
'METHOD' => 'GetTransactionDetails',
'PWD' => 'UVAYAK9WMNPP75KA',
'USER' => 'leonardoccleao_api1.gmail.com',
'SIGNATURE' => 'AFcWxV21C7fd0v3bYYYRCpSSRl31AYlssmYYHWWmVugX7vy.se0mIMAM',
'VERSION' => '84',
);
$curl = curl_init();
curl_setopt( $curl , CURLOPT_URL , 'https://api-3t.paypal.com/nvp' );
curl_setopt( $curl , CURLOPT_SSL_VERIFYPEER , false );
curl_setopt( $curl , CURLOPT_RETURNTRANSFER , 1 );
curl_setopt( $curl , CURLOPT_POST , 1 );
curl_setopt( $curl , CURLOPT_POSTFIELDS , http_build_query( $nvp ) );
$response = urldecode( curl_exec( $curl ) );
$responseNvp = array();
if ( preg_match_all( '/(?<name>[^\=]+)\=(?<value>[^&]+)&?/' , $response , $matches ) ) {
foreach ( $matches[ 'name' ] as $offset => $name ) {
$responseNvp[ $name ] = $matches[ 'value' ][ $offset ];
}
}
$fee_amount = $responseNvp['FEEAMT'];//fee recovered
echo $fee_amount;//I get to print the fee
curl_close( $curl );
//---------/end routine to recover the fee on database Paypal //--------//
我通过向 PayPal 提供交易 ID (txv_id) 来收取费用,但它仅适用于某些交易。在某些交易中,PayPal 退回费用 = 0。
我制作了一个脚本来用一系列交易填充数据表,但在通过贝宝进行的 40 笔交易中,我只收到了 2 笔费用。交易具有相同的产品和相同的价格,但并不总是相同的费用
我想知道 PayPal 是否有其他方法可以返回此属性