omise / omise-opencart

Omise OpenCart Plugin
https://docs.opn.ooo/opencart-plugin
MIT License
10 stars 11 forks source link

Make charge with Internet Banking by passing 'offsite' param & handle callback #41

Closed iwat closed 7 years ago

iwat commented 7 years ago

This PR requires #40 to be merged first.

1. Objective

To make charge with Internet Banking payment method and handle the callback.

2. Description of change

Once a user select an internet banking provider and click the submit button, the page will use XHR to call the checkout method of the offsite extension. The extension then adds order to the database with pending state and calls Omise charge API with offsite parameter (see https://www.omise.co/offsite-payment) and returns authorize_uri to the front end.

The front end will then redirect user to bank authorize page, allowing users to enter their credentials and it will redirect back to OpenCart offsite extension's callback page. The callback page checks for payment result and update order status to either success or failed, then redirects user to the appropriated page.

3. Quality assurance

🔧 Environments:

✏️ Details:

new-charge charge-info

4. Impact of the change

This PR changes no UI. But make the flow success.

5. Priority of change

Normal.

6. Additional notes

This PR requires #40 to be merged first.