paypal-payment-gateway-integration-laravel
paypal-payment-gateway-integration-laravel copied to clipboard
Setting currency dynamically for multiple currency app.
Hello , Thanks for your nice paypal payment gateway integration process.all things are ok for me.but i have problem when i want to set currency dynamically . can you help?
$item_1->setName('Item 1') /** item name / ->setCurrency('USD') ->setQuantity(1) ->setPrice($request->get('amount')); / unit price **/ $item_list = new ItemList(); $item_list->setItems(array($item_1)); $amount = new Amount(); $amount->setCurrency('USD') ->setTotal($request->get('amount'));
from the upper code i tried to change setCurrency('USD') i tried to put a currency code dynamically instead 'USD' simply passing a variable along with paypal checkout form following the code: https://developer.paypal.com/docs/api/reference/currency-codes/ .
but shows this error: Got Http response code 400 when accessing https://api.sandbox.paypal.com/v1/payments/payment
thanks in advance.