Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create-pay-pal-order route fails when using promotion code #165

Closed
LaskeJu opened this issue Nov 15, 2020 · 4 comments
Closed

create-pay-pal-order route fails when using promotion code #165

LaskeJu opened this issue Nov 15, 2020 · 4 comments
Labels

Comments

@LaskeJu
Copy link
Contributor

LaskeJu commented Nov 15, 2020

When I perform a payment, while i using an discount code. The create-pay-pal-order route fails and i cant pay my order.

@Zales0123 Zales0123 added the Bug label Nov 15, 2020
@LaskeJu
Copy link
Contributor Author

LaskeJu commented Nov 29, 2020

I have added the following code to fix the error:
File: "Api/CreateOrderApi.php" => "public function create(string $token, PaymentInterface $payment, string $referenceId): array"

                        'tax_total' => [
                            'currency_code' => $order->getCurrencyCode(),
                            'value' => $payPalItemData['total_tax'],
                        ],

                        //added this:
                        'discount' => [
                            'currency_code' => $order->getCurrencyCode(),
                            'value' => abs($order->getOrderPromotionTotal()) / 100,
                        ]

This is how it works for me.

@romainguerrero
Copy link

@LaskeJu we have the problem too. Are you able to propose your fix in a PR as it can be shared to everyone ?

@LaskeJu
Copy link
Contributor Author

LaskeJu commented Dec 14, 2020

@romainguerrero added PR #175

@Zales0123
Copy link
Member

I believe it can be closed due to #175 🖖

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants