04. Routes - cafe24github/cafe24_app_pg_sample GitHub Wiki
Contents
- Checkout (Synchronous)
- Checkout (Asynchronous)
- External Checkout
- Cancellation (Synchronous)
- Cancellation (Asynchronous)
Legends
:link: : Endpoint path
:telephone: : Entity calling the endpoint
Checkout (Synchronous)
Checkout Request
This endpoint is accessed by Cafe24, receiving the checkout data from the Cafe24 EC mall. It will return the payment URL where Cafe24 will redirect the buyer to approve the payment.
:link:
/api/synchronous-checkout/checkout:telephone: Cafe24
Callback
The PG Company will call this endpoint after the buyer approves the payment request. It will verify and update the order status in the app's database. It will then redirect to Cafe24's return URL (return_url) to update the payment status.
:link:
/api/synchronous-checkout/checkout/callback:telephone: PG Company
Read Payment Details
Cafe24 will call this endpoint to verify the payment status of the order from the PG Company which is already stored in the PG app's database.
:link:
/api/synchronous-checkout/checkout/status:telephone: Cafe24
Checkout (Asynchronous)
Checkout Request
This endpoint is called the Cafe24, receiving the checkout data from the Cafe24 EC mall. It will return the payment URL where Cafe24 will redirect the buyer to approve the payment.
:link:
/api/asynchronous-checkout/checkout:telephone: Cafe24
Callback
The PG Company will call this endpoint after the buyer approves the payment request. It will verify and store new order details from the PG Company. It will then redirect to Cafe24's return URL (return_url).
:link:
/api/asynchronous-checkout/checkout/callback:telephone: PG Company
Webhook
The PG Company will call this endpoint to update the PG app for the payment status. The app will then call the noty URL (return_noty_url) of Cafe24 to update them on the status asynchronously.
:link:
/api/asynchronous-checkout/checkout/webhook:telephone: PG Company
External Checkout
Payment Button Initialization
The Cafe24 Mall Front will call this endpoint if the PG app's "script-caller.js" is installed in a shop through the Cafe24 Scripttag API. This endpoint will append the functional JavaScript files for the payment button
:link:
/api/external-checkout/script:telephone: Cafe24 Mall Front
The Cafe24 Mall Front will call this endpoint to retrieve the necessary data to initialize and display the payment button in the shop.
:link:
/api/external-checkout/script/data:telephone: Cafe24 Mall Front
External Checkout Request
The Cafe24 Mall Front will call this endpoint to request HMAC data. The generated HMAC is going to be used in reserving an order to Cafe24 (precreateOrder API)
:link:
/api/external-checkout/script/hmac:telephone: Cafe24 Mall Front
The Cafe24 Mall Front will call this endpoint to create a checkout request to the PG Company and process the response which will be passed to the PG Company's JavaScript SDK to start the payment process.
:link:
/api/external-checkout/payload:telephone: Cafe24 Mall Front
The PG Company will call this endpoint to preview the summary of the order that the buyer will pay. This endpoint is optional because there are PG Companies that will redirect the buyer to their own payment preview page, but there are also PG Companies that will require the PG app to provide this endpoint.
:link:
/api/external-checkout/order/review:telephone: PG Company
The PG app will call this endpoint to send the approval of payment to the PG Company when the buyer proceeds with the checkout after confirming in the Order Preview Page. This endpoint is also only required if the PG Company will need the PG app to provide a review page.
:link:
/api/external-checkout/order/pay:telephone: PG App
External Checkout Callback
The PG Company will call this endpoint to provide updates on the payment. The PG app will then send the updates to Cafe24 through the external return notification URL (return_notification_url).
:link:
/api/external-checkout/order/callback:telephone: PG App
Cancellation (Synchronous)
Cancellation Request
Cafe24 will call this endpoint for the cancellation of order payment. The PG app makes the request to the PG Company and returns the result back to Cafe24
:link:
/api/synchronous-cancellation/cancel:telephone: Cafe24
Cancellation (Asynchronous)
Cancellation Request
Cafe24 will call this endpoint for the cancellation of order payment. The PG app makes the request to the PG Company.
:link:
/api/asynchronous-cancellation/cancel:telephone: Cafe24
Webhook
The PG Company will call this endpoint to notify the PG app of the cancellation request status. The app will update Cafe24 on the cancellation status by calling the cancellation noty URL (cancel_noty_url) asynchronously.
:link:
/api/asynchronous-cancellation/cancel/webhook:telephone: PG Company