coopcycle / coopcycle-app

CoopCycle native app
MIT License
152 stars 33 forks source link

Replace the in-app payment screen with a webview #1573

Open r0xsh opened 1 year ago

r0xsh commented 1 year ago

To streamline the application by reducing dependencies and paving the way for seamless integration with payment providers, we aim to implement a payment solution using the WebView component.

The goal is to update the endpoint, /api/orders/:id/pay, which will facilitate payments through a WebView for specific payment providers. This endpoint should respond with JSON structured as follows:

{
  "type": "webview",
  "webview_url": "https://xxx.coopcycle.org/orders/:id/pay/webview?=:payment_provider"
}

The payment process itself will be managed within the WebView using a web form. Upon completion of the payment process within the WebView, a custom JavaScript event will be triggered. This event, as described in the React Native WebView documentation, will notify the React Native application about the payment's status, whether it succeeded, failed, or was abandoned.

vladimir-8 commented 1 month ago

https://github.com/orgs/coopcycle/discussions/33

Paul-Eraman-CoopCycle commented 3 weeks ago

@alexsegura are we doing this? if not, ill close