Skip to content

Setting currency dynamically for multiple currency app.  #4

@devlimon

Description

@devlimon

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions