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

Credit Card payment status #131

Open
prugala opened this issue Jan 9, 2024 · 4 comments
Open

Credit Card payment status #131

prugala opened this issue Jan 9, 2024 · 4 comments

Comments

@prugala
Copy link

prugala commented Jan 9, 2024

Hello, I have a problem with creating order with credit card. My array with order data (simplified):

$order['payMethods'] = [
                'payMethod' => [
                    'value' => 'Token from frontend widget or from previous user order',
                    'type' => 'CARD_TOKEN',
                ],
            ];

$response = \OpenPayU_Order::create($order);

I'm using sandbox and card listed on your website, order is created and I get response but when I get information about order, order has status pending

$data = \OpenPayU_Order::retrieve($orderId);

$data->getResponse()->orders[0]->status - PENDING

I can't find information what should I do for the order to have the SUCCESS status.

@peterpp
Copy link

peterpp commented Jan 9, 2024

Hello, PENDING is a regular order state and can last really long. You have two options:

a) Implement asynchronous notification mechanism
If you set notifyUrl parameter while creating an order, PayU will call this URL with every status change.

b) Actively wait for the order to be finished
You can call OpenPayU_Order::retrieve in some smart cycle (let's say every 5 seconds, up to 30 seconds). But be beware, that finishing the order can take much longer! I've seen 5 minutes interval even with Apple Pay in real life. So you still need to handle longer payments in some asynchronous way.

@regdos
Copy link
Contributor

regdos commented Jan 9, 2024

Hello.

In $response should be redirect url to 3DS, you need to redirect to it.

@prugala
Copy link
Author

prugala commented Jan 10, 2024

@peterpp @regdos thank you for you response.
I'm using sandbox card 4444333322221111 and there is no 3DS. In response don't have redirectUri property.

Im checking status with OpenPayU_Order::retrieve after 10-15 minutes and still is pending

Example orderId: X46VN8NSD2240110iafvzis8P01

I attach screenshots with order response, order payload, and response from retrieve method.

Screenshots are from two different orders but response is always same for all orders.

Order response: Zrzut ekranu 2024-01-10 o 17 24 47

Order payload:
Zrzut ekranu 2024-01-10 o 17 25 18

retrieve response:
Zrzut ekranu 2024-01-10 o 17 28 22

@regdos
Copy link
Contributor

regdos commented Jan 10, 2024

I can see that use stored card token to recurring payment.
First transaction this token must be with 3DS so please use card with challenge from https://developers.payu.com/europe/pl/docs/testing/sandbox/#sandbox-test-cards

Please reffer with https://developers.payu.com/europe/pl/docs/payment-solutions/cards/tokenization/ and if you will have problem please contact to BOK PayU.

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

No branches or pull requests

3 participants