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

Redirect buyer out to the internet banking page if the placeOrder action is succeeded #66

Merged
merged 3 commits into from
Mar 31, 2017

Conversation

guzzilar
Copy link
Contributor

@guzzilar guzzilar commented Mar 31, 2017

⚠️ This PR is a sub PR of #62

1. Objective

To handle the placeOrder action, either redirect buyer out to the internet banking page (if the action is succeeded) or raise an error message onto the screen (if the action is failed).

Related information:
Related issue(s): 🙅

2. Description of change

• Implement RESTFul API GET orders/:order_id/omise-offset

Because Magento 2 moved the placeOrder action out to the client side, and place an order through Ajax > RESTful API. But unfortunately, that API's response can't send a payment method detail or authorize_uri back, so we have to make new API and make a request again to retrieve that information.

• Update JS model to make a redirection and handle either success/fail case.

• Save omise.charge.id, omise.charge.authorize_uri to an order record after payment process is done.

3. Quality assurance

🔧 Environments:

  • Platform version: Magento CE 2.1.5.
  • PHP version: 7.0.16.

✏️ Details:

  1. ✅ Once buyer place an order with internet banking payment, buyer will be redirected to the internet banking page.

    1. Just do normal checkout process and submit (place order).
    2. Buyer will be redirected out to the internet banking page.
    screen shot 2560-03-31 at 5 58 00 pm
  2. ✅ Test access an API directly, user would be rejected. (because user's session is not match with the user's cart).
    screen shot 2560-03-31 at 6 50 18 pm

  3. ✅ In case something wrong with a new API, an error message will be raised as the below screenshot.
    screen shot 2560-03-31 at 6 54 43 pm

4. Impact of the change

Now buyer will be redirected out to the internet banking page after place an order.

5. Priority of change

Normal.

6. Additional Notes

  • This PR doesn't include the callback part, so, once buyer finish the internet banking process, buyer will be redirect back to a store, and then, store will raise an 404 page not found error.

@guzzilar
Copy link
Contributor Author

👍

@guzzilar guzzilar merged commit ccf3849 into internet-banking Mar 31, 2017
@guzzilar guzzilar deleted the ib-redirect-buyer-to-ib-page branch March 31, 2017 11:57
@guzzilar guzzilar mentioned this pull request Apr 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant