Paypal REST API Bug - Fee Charged By PayPal NOT SET in Response -
update: issue applies both test , live api requests
at first thought test environment bug i've confirms applies production well. it's critical know fees charged paypal
.
is there way paypal test environment (developer.paypal.com) respond fees charged paypal? neither sale
or sale lookup
seem return paypal fee
seen in live transactions. forced test live transactions (not best practice)? without same fee values see in live environment, hard unit test our accounting system in development.
request - credit card charge ($43) stored card
$cardtoken = new creditcardtoken(); $cardtoken->setcredit_card_id( $cc->getrefid() ); $fi = new fundinginstrument(); $fi->setcredit_card_token( $cardtoken ); $payer = new payer(); $payer->setpayment_method('credit_card'); $payer->setfunding_instruments(array($fi)); $amount = new amount(); $amount->setcurrency('usd'); $amount->settotal('43.00'); $transaction = new transaction(); $transaction->setamount($amount); $transaction->setdescription($note); $payment = new payment(); $payment->setintent('sale'); $payment->setpayer($payer); $payment->settransactions(array($transaction)); $response = $payment->create();
response - approved (full response)
paypal\api\transaction object ( [_propmap:ppmodel:private] => array ( [amount] => paypal\api\amount object ( [_propmap:ppmodel:private] => array ( [total] => 43.00 [currency] => usd [details] => paypal\api\amountdetails object ( [_propmap:ppmodel:private] => array ( [subtotal] => 43.00 ) ) ) )
documentation - fee charged paypal
(below image) - details object from documentation showing (string) fee charged paypal
- doesn't seem expose in test environment.
use nvp api (gettransactiondetails request) return more accurate details in place of or along side standard rest responses. if you're interested can post php example.
the rest api allows things manage credit card vault.. can store card , charge card rest .. when charge it, return nvp api gettransactiondetails response includes fees charged paypal
, else need know transaction charged via rest. maybe hack , involve api call works well.
Comments
Post a Comment