We currently process USD payments via paypal's REST API using their ruby gem. I would like to accept other currencies and have set our account to auto-convert foreign currency payments to USD. I can successfully process these payments and can see in the sandbox web interface that they were converted, but it's unclear to me how to look the conversion transactions up via the API. Can anyone shed any light on this? See screenshot and completed payment + sale record below.
Response[200]: OK, Duration: 0.858s
{
"id" => "PAY-0XK33729VB648561PKV5SG6A",
"intent" => "sale",
"payer" => {
"payment_method" => "paypal",
"status" => "VERIFIED",
"payer_info" => {
"email" => "[email protected]",
"first_name" => "Fake",
"last_name" => "Fakerson",
"payer_id" => "F2JC8YDQ6HDUA",
"shipping_address" => {
"line1" => "1 Main St",
"city" => "San Jose",
"state" => "CA",
"postal_code" => "95131",
"country_code" => "US",
"recipient_name" => "Fake Fakerson"
}
}
},
"transactions" => [
[0] {
"amount" => {
"currency" => "EUR",
"total" => "5.00",
"details" => {
"subtotal" => "5.00"
}
},
"description" => "Unlimited School - I'm a course",
"related_resources" => [
[0] {
"sale" => {
"id" => "24439073LW446012K",
"amount" => {
"currency" => "EUR",
"total" => "5.00"
},
"payment_mode" => "INSTANT_TRANSFER",
"state" => "completed",
"protection_eligibility" => "ELIGIBLE",
"protection_eligibility_type" => "ITEM_NOT_RECEIVED_ELIGIBLE,UNAUTHORIZED_PAYMENT_ELIGIBLE",
"transaction_fee" => {
"currency" => "EUR",
"value" => "0.50"
},
"parent_payment" => "PAY-0XK33729VB648561PKV5SG6A",
"create_time" => "2015-06-12T18:22:48Z",
"update_time" => "2015-06-12T18:23:19Z",
"links" => [
[0] {
"href" => "https://api.sandbox.paypal.com/v1/payments/sale/24439073LW446012K",
"rel" => "self",
"method" => "GET"
},
[1] {
"href" => "https://api.sandbox.paypal.com/v1/payments/sale/24439073LW446012K/refund",
"rel" => "refund",
"method" => "POST"
},
[2] {
"href" => "https://api.sandbox.paypal.com/v1/payments/payment/PAY-0XK33729VB648561PKV5SG6A",
"rel" => "parent_payment",
"method" => "GET"
}
]
}
}
]
}
],
"state" => "approved",
"create_time" => "2015-06-12T18:22:48Z",
"update_time" => "2015-06-12T18:23:19Z",
"links" => [
[0] {
"href" => "https://api.sandbox.paypal.com/v1/payments/payment/PAY-0XK33729VB648561PKV5SG6A",
"rel" => "self",
"method" => "GET"
}
]
}
I don't think so that REST API has any API for fetching the currency conversion only at this moment .
However , you can use the PayPal's Classic API to achieve your goal . See the example below :
NVP Request: