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

G2APAY order status doesnt forward to complete #3353

Closed
sterrek opened this issue Sep 17, 2015 · 20 comments
Closed

G2APAY order status doesnt forward to complete #3353

sterrek opened this issue Sep 17, 2015 · 20 comments

Comments

@sterrek
Copy link

sterrek commented Sep 17, 2015

Hi,

I use opencart 2.0.3.1 with g2apay
But when i get a order it does not forward from pending to complete.
When i go to g2apay merchent page i see there that the order is complete.
i added some pictures of my settings.
orderstatus

g2settins

I hope somebody knows a fix or see what i did wrong.

Kind regards

@sterrek
Copy link
Author

sterrek commented Sep 17, 2015

@chris-wm maby you know the answer ?
Update: With paypal i dont have any problems. only when costumers checkout with ideal.

@chris-wm
Copy link
Contributor

@sterrek Hi, the order status is updated by the IPN so the most likely cause is that the IPN URL is not set-up correctly in G2A Pay. You can check that the IPN is going through successfully by enabling debugging in the G2A module and then checking for the debug code "token success" in g2apay.log in the log folder,
regards

@sterrek
Copy link
Author

sterrek commented Sep 21, 2015

@chris-wm i see this:
2015-09-21 18:37:31 - Origin: ControllerPaymentG2APay::ipn
2015-09-21 18:37:31 - Origin: ControllerPaymentG2APay::ipn
2015-09-21 18:37:31 - ipn
2015-09-21 18:37:31 - ipn
2015-09-21 18:37:31 - Origin: ControllerPaymentG2APay::ipn
2015-09-21 18:37:31 - token success
2015-09-21 18:37:31 - Origin: ControllerPaymentG2APay::ipn
2015-09-21 18:37:31 - token success
2015-09-21 18:37:31 - Origin: ControllerPaymentG2APay::ipn
2015-09-21 18:37:31 - Hashes do not match, possible tampering!
2015-09-21 18:37:31 - Origin: ControllerPaymentG2APay::ipn
2015-09-21 18:37:31 - Hashes do not match, possible tampering!

@chris-wm
Copy link
Contributor

@sterrek Hi, can you tell me if there is anything in the history for the order, possibly the status has been updated more than once, to completed and back again to pending. Can you also update the following file catalog\controller\payment\g2apay.php with the one https://drive.google.com/file/d/0B0thHgBjXmj_eU5kZDlzNnIxMDg/view?usp=sharing, try again and tell me what appears in your log,
regards

@sterrek
Copy link
Author

sterrek commented Sep 28, 2015

@chris-wm i did what you said. now i still doesnt work.

Log files

)

2015-09-28 20:07:03 - Origin: ControllerPaymentG2APay::ipn
2015-09-28 20:07:03 - ipn
2015-09-28 20:07:03 - Origin: ControllerPaymentG2APay::ipn
2015-09-28 20:07:03 - token success
2015-09-28 20:07:03 - Origin: ControllerPaymentG2APay::ipn
2015-09-28 20:07:03 - Hashes do not match, possible tampering!
2015-09-28 20:07:03 - Origin: ControllerPaymentG2APay::ipn
2015-09-28 20:07:03 - ipn
2015-09-28 20:07:03 - Origin: ControllerPaymentG2APay::ipn
2015-09-28 20:07:03 - token success
2015-09-28 20:07:03 - Origin: ControllerPaymentG2APay::ipn
2015-09-28 20:07:03 - Hashes do not match, possible tampering!

@chris-wm
Copy link
Contributor

@sterrek were you able to check the order history to see if the status had been changed at any point?
Regards

@sterrek
Copy link
Author

sterrek commented Sep 30, 2015

@chris-wm it did not changed anything only to pending

@chris-wm
Copy link
Contributor

@sterrek I have updated the file with more debug, can you try again and post me the results,
regards

@sterrek
Copy link
Author

sterrek commented Sep 30, 2015

@chris-wm i just get a white page right now. when i want to checkout with g2apay

@chris-wm
Copy link
Contributor

@sterrek Can you download the file again and upload once more, I have only made changes to the response code so it should not affect the checkout page. Are there any errors in your log?
Regards

@sterrek
Copy link
Author

sterrek commented Sep 30, 2015

@chris-wm i left my api clear only for this page. so that not everybody can see it. but i still not forwarding to complete. btw thank you for helping !
)

2015-09-30 18:07:35 - Origin: ControllerPaymentG2APay::checkout
2015-09-30 18:07:35 - 3.87
2015-09-30 18:07:35 - Origin: ControllerPaymentG2APay::checkout
2015-09-30 18:07:35 - Array
(
[0] => stdClass Object
(
[sku] => shipping
[name] => Gratis verzending
[amount] => 0.00
[qty] => 1
)

[1] => stdClass Object
    (
        [sku] => 665
        [name] => HearthStone: Heroes of Warcraft (Deck of Cards DLC)
        [amount] => 3.87
        [qty] => 1
    )

)

2015-09-30 18:07:35 - Origin: ControllerPaymentG2APay::checkout
2015-09-30 18:07:35 - Array
(
[api_hash] =>
[hash] =>
[order_id] => 123347
[amount] => 3.87
[currency] => EUR
[email] => manuel_sterk@hotmail.com
[url_failure] => https://actiehunt.nl/index.php?route=checkout/failure
[url_ok] => https://actiehunt.nl/index.php?route=payment/g2apay/success
[items] => [{"sku":"shipping","name":"Gratis verzending","amount":"0.00","qty":1},{"sku":"665","name":"HearthStone: Heroes of Warcraft (Deck of Cards DLC)","amount":3.87,"qty":"1"}]
)

2015-09-30 18:08:33 - Origin: ControllerPaymentG2APay::ipn
2015-09-30 18:08:33 - ipn
2015-09-30 18:08:33 - Origin: ControllerPaymentG2APay::ipn
2015-09-30 18:08:33 - ipn
2015-09-30 18:08:33 - Origin: ControllerPaymentG2APay::ipn
2015-09-30 18:08:33 - token success
2015-09-30 18:08:33 - Origin: ControllerPaymentG2APay::ipn
2015-09-30 18:08:33 - token success
2015-09-30 18:08:33 - Origin: ControllerPaymentG2APay::ipn
2015-09-30 18:08:33 - 3.87
2015-09-30 18:08:33 - Origin: ControllerPaymentG2APay::ipn
2015-09-30 18:08:33 - 1233473.87Vz8D1@2rZz#OOHGHMWZXCU&YLJem4-9ZkIml9oNhYF!wW6?sbXAo_767QktUV=+<
2015-09-30 18:08:33 - Origin: ControllerPaymentG2APay::ipn
2015-09-30 18:08:33 - 3.87
2015-09-30 18:08:33 - Origin: ControllerPaymentG2APay::ipn
2015-09-30 18:08:33 - dd75105a3b5308def841e3f37b71432d50dbd91bd45fdd9f87c105266fe27aa5
2015-09-30 18:08:33 - Origin: ControllerPaymentG2APay::ipn
2015-09-30 18:08:33 - 1233473.87Vz8D1@2rZz#OOHGHMWZXCU&YLJem4-9ZkIml9oNhYF!wW6?sbXAo_767QktUV=+<
2015-09-30 18:08:33 - Origin: ControllerPaymentG2APay::ipn
2015-09-30 18:08:33 - 68667cb226fb8db1f2818dfec44b8cf202b5a1d20c4a0bbc11fe17ec2a0a2e15
2015-09-30 18:08:33 - Origin: ControllerPaymentG2APay::ipn
2015-09-30 18:08:33 - dd75105a3b5308def841e3f37b71432d50dbd91bd45fdd9f87c105266fe27aa5
2015-09-30 18:08:33 - Origin: ControllerPaymentG2APay::ipn
2015-09-30 18:08:33 - Hashes do not match, possible tampering!
2015-09-30 18:08:33 - Origin: ControllerPaymentG2APay::ipn
2015-09-30 18:08:33 - 68667cb226fb8db1f2818dfec44b8cf202b5a1d20c4a0bbc11fe17ec2a0a2e15
2015-09-30 18:08:33 - Origin: ControllerPaymentG2APay::ipn
2015-09-30 18:08:33 - Hashes do not match, possible tampering!

@chris-wm
Copy link
Contributor

chris-wm commented Oct 2, 2015

@sterrek Hi, can you ask G2A if they have something different for the string before it is hashed for that specific order number IPN. The problem is that the hash they send does not match the one calculated by the module for security purposes, the info they might need is

  • Order id - 123347
  • pre hashed sting - 1233473.87Vz8D1@2rZz#OOHGHMWZXCU&YLJem4-9ZkIml9oNhYF!wW6?sbXAo_767QktUV=+<
  • module hash - dd75105a3b5308def841e3f37b71432d50dbd91bd45fdd9f87c105266fe27aa5
  • g2a hash - 68667cb226fb8db1f2818dfec44b8cf202b5a1d20c4a0bbc11fe17ec2a0a2e15
    They should hopefully be able to shed some light on this,
    regards

@sterrek
Copy link
Author

sterrek commented Oct 6, 2015

@chris-wm Thank you. i pasted this problem the g2a im still waiting on the answer of G2A IT department. But they are really slow in answering.

@sterrek
Copy link
Author

sterrek commented Oct 8, 2015

@chris-wm Hi, this was there response today.

We are still waiting for respond from IT team, please check if you calculate hash from those variablles:

{transactionId}{userOrderId}{amount}{ApiSecret}
ApisSecret- you can find it at yor g2a pay account

@sterrek
Copy link
Author

sterrek commented Oct 21, 2015

@chris-wm hi they told me this. Could you may look at this: strange, i dont know if this is new/ updated by g2a or what but it seems like the required fields id, url and price for the products are missing in the call.

Iv'e edited:

foreach ($ordered_products as $product) {


    $item = new stdClass();
    $item->sku = $product['product_id'];
    $item->name = $product['name'];
    $item->amount = $product['price'] * $product['quantity'];
    $item->qty = $product['quantity'];
    $items[] = $item;
}

From the controller an changed it to:

foreach ($ordered_products as $product) {


    $item = new stdClass();
    $item->sku = $product['product_id'];
    $item->name = $product['name'];
    $item->amount = $product['price'] * $product['quantity'];
    $item->price = number_format($product['price'], 2);
    $item->id = $product['model'];
    $item->url = "http://utcoinbets.co.uk/index.php?route=product/product&product_id=".$product['product_id'];
    $item->qty = $product['quantity'];
    $items[] = $item;
}

Seemes to get rid of the error anyway, someone feel free to tell me if im wrong. Thanks

@chris-wm
Copy link
Contributor

@sterrek Hi, we actually received an email yesterday from G2A telling us that they wished to update their OpenCart gateway, it appears that they have updated their payment system so that the current OpenCart implementation is incompatible. They sent me a patch that looks similar to yours but with a few extra bits, I cannot vouch for it's quality but we will be releasing a bug fix version of OpenCart with the official release at some point soon. You can find the patch they sent me here https://drive.google.com/file/d/0B0thHgBjXmj_cUZSeGU1VU9JRHM/view?usp=sharing,
regards

@craigbaines
Copy link

was there any update on this?

I have the latest code you posted but the status is still not getting updated correctly.

Debug said:

2015-10-25 11:49:26 - Origin: ControllerPaymentG2APay::ipn
2015-10-25 11:49:26 - Hashes do not match, possible tampering!

@sterrek
Copy link
Author

sterrek commented Oct 25, 2015

@craigbaines hi,

I just got a messages from g2a.
That they are testing the new plug in,
When i have it. i will send it here.

Kind regards.

@craigbaines
Copy link

Ok thanks, still have issues here so that would be appreciated.

@chris-wm
Copy link
Contributor

The patch for the updated G2A API was added in the following commit 8131e2f and will be included in the next release of OpenCart

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

4 participants