diff --git a/.gitmodules b/.gitmodules index 43b9c6a..053755f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,7 @@ [submodule "themes/hexon-hugo-theme"] path = themes/hexon-hugo-theme +<<<<<<< HEAD url = git@github.com:OdinsPlasmaRifle/hexon-hugo-theme.git +======= + url = https://github.com/OdinsPlasmaRifle/hexon-hugo-theme.git +>>>>>>> 352468ee464880e3a784cf2ad787f278d79c94a6 diff --git a/config.yaml b/config.yaml index ff483f2..28f1901 100644 --- a/config.yaml +++ b/config.yaml @@ -7,6 +7,8 @@ params: companyName: ExampleCompany companyId: example_company appUrl: https://wallet.example.com + invoicesApi: https://api.invoices.example.com + businessApi: https://api.business.example.com logoUrl: https://example.com logoImage: https://rehive.s3.amazonaws.com/companies/2458/logos/6c4d8de546d74b30a3d19c78fb42ec16_1611825066.png heroImage: https://rehive.s3.amazonaws.com/companies/2458/logos/6c4d8de546d74b30a3d19c78fb42ec16_1611825066.png @@ -21,4 +23,4 @@ params: extraFooterItems: - title: Log in - url: https://wallet.example.com \ No newline at end of file + url: https://wallet.example.com diff --git a/content/checkout/_index.md b/content/checkout/_index.md index cb0f6ac..062f8c8 100644 --- a/content/checkout/_index.md +++ b/content/checkout/_index.md @@ -1,7 +1,7 @@ --- date: 2018-09-17T15:21:22+02:00 title: Merchant checkout -description: Merchent checkout API documentation. +description: Merchant checkout API documentation. weight: 1 linkTo: /checkout/get-started/introduction --- diff --git a/content/checkout/core-resources/invoice.md b/content/checkout/core-resources/invoice.md index 891d957..c6ef214 100644 --- a/content/checkout/core-resources/invoice.md +++ b/content/checkout/core-resources/invoice.md @@ -47,7 +47,7 @@ cancelled | The invoice has been set to cancelled by a manager. "metadata": null, "status": "overpaid", "account": null, - "redirect_url": "?request=deb62287-dbc6-4f11-8f83-d753f6cf1284", + "redirect_url": "{{param appUrl}}?request=deb62287-dbc6-4f11-8f83-d753f6cf1284", "payer_email": "customer@example.com", "return_url": null, "payment_processor_quotes": [ diff --git a/content/checkout/core-resources/payment-processor.md b/content/checkout/core-resources/payment-processor.md index 1368e02..b655f77 100644 --- a/content/checkout/core-resources/payment-processor.md +++ b/content/checkout/core-resources/payment-processor.md @@ -7,7 +7,7 @@ weight: 2 ### Object -Payment processors objects contain information for the relevant payment options available for users. They are identified by the `unique_string_name` field which can be used to PATCH the Invoice’s `primariy_payment_processor` field for selecting/changing payment processors. +Payment processors objects contain information for the relevant payment options available for users. They are identified by the `unique_string_name` field which can be used to PATCH the Invoice’s `primary_payment_processor` field for selecting/changing payment processors. Each payment processor has a unique subtype and identifier field diff --git a/content/checkout/custom-integration/closed-loop.md b/content/checkout/custom-integration/closed-loop.md index 1e2a518..63733f8 100644 --- a/content/checkout/custom-integration/closed-loop.md +++ b/content/checkout/custom-integration/closed-loop.md @@ -20,22 +20,15 @@ The required information from the user is: Once the user has provided this information you will need to PATCH the Invoice as follows: ``` -curl -X PATCH "/requests//" -H "accept: application/json" +curl -X PATCH "{{}}/api/requests//" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \"payer_email\": \"user@example.com\", \"payer_mobile_number\": \"+27777777777\"}" ``` -If successful the user will receive an SMS with the OTP code. You will need to provide a way for the user to enter this code so you can make a POST request to: `/manager/businesses//invoice//otp-challenge` as follows: +If successful the user will receive an SMS with the OTP code. You will need to provide a way for the user to enter this code so you can make a POST request to: `{{}}/api/manager/businesses//invoice//otp-challenge/` as follows: ``` -curl -X POST "/requests//otp_challenge/" +curl -X POST "{{param invoicesApi}}/requests//otp_challenge/" -H "accept: application/json" -H "Content-Type: application/json" --data '{"otp": "401703"}' ``` This is a simple Success/Response endpoint. On a successful 201 response a transfer will be created automatically between you and the user. Any errors will need to be forwarded to the end user. - - - - - - - diff --git a/content/checkout/custom-integration/invoicing.md b/content/checkout/custom-integration/invoicing.md index 697885d..da0ac5c 100644 --- a/content/checkout/custom-integration/invoicing.md +++ b/content/checkout/custom-integration/invoicing.md @@ -20,7 +20,7 @@ The first step to initiate the payment process is to create an invoice. This wou ### Endpoints URL | methods ---|--- -`​/manager​/businesses​/{business_id}​/invoices​/` | `POST` +`{{params businessApi}}​/api/manager​/businesses​/{business_id}​/invoices​/` | `POST` ### Example data: ``` @@ -54,7 +54,7 @@ URL | methods "description": "Online payment for clothes", "status": "initiated", "return_url": "https://my-ecommerce-store.com/order/", - "redirect_url": "https://.com/?request=e7d7a5a2-9a97-4930-a992-589a6133488f&return_url=https://my-ecommerce-store.com/order/", + "redirect_url": "https://{{params appUrl}}.com/?request=e7d7a5a2-9a97-4930-a992-589a6133488f&return_url=https://my-ecommerce-store.com/order/", "payment_processor_quotes": [], "created": 0, "updated": 0 @@ -72,7 +72,7 @@ In the case where an invoice is no longer valid the status can be PATCH’d usin ### Endpoints URL | methods ---|--- -`​/manager​/businesses​/{business_id}​/invoices​/` | `PATCH` +`​{{}}/api/manager​/businesses​/{business_id}​/invoices​/` | `PATCH` PATCH the endpoint with the new `cancelled` status and this will stop the user from viewing/interacting with the invoice. diff --git a/content/checkout/custom-integration/open-loop.md b/content/checkout/custom-integration/open-loop.md index 22a0be7..b7d237c 100644 --- a/content/checkout/custom-integration/open-loop.md +++ b/content/checkout/custom-integration/open-loop.md @@ -33,7 +33,7 @@ The reference is the Bitcoin address generated for this deposit which the user p ### Handling statuses ##### Processing -The user has chosen a payment processor. In certain open-loop cases you might want to pole the `/manager/businesses//invoices//transactions/` endpoint to check for new deposits being made. This is particularly important in the case of crypto deposits waiting for confirmations. +The user has chosen a payment processor. In certain open-loop cases you might want to poll the `{{params businessApi}}/api/manager/businesses//invoices//transactions/` endpoint to check for new deposits being made. This is particularly important in the case of crypto deposits waiting for confirmations. ##### Paid If the amount sent by the user matches the quoted amount exactly the entire Invoice will be set to the Paid status. Once this has happened you can assume the funds have been received and processed. Any order statuses on your e-commerce platform can be set to their Completed states. @@ -50,7 +50,7 @@ Any requests that expire are no longer usable and a new Invoice will need to be ### Displaying processing Crypto transactions One of the unique aspects about cryptocurrency is transactions often need to be confirmed multiple times before they can be considered completely irreversible. This means that a user might make a deposit to pay for an Invoice but the invoice will only Complete once the transaction associated with it Complete/is confirmed. You will want to display this to the user so they know they have a pending successful transaction. -To display this information you will use the transactions endpoint of the invoice: `/manager/businesses//invoices//transactions/`. +To display this information you will use the transactions endpoint of the invoice: `{{}}/api/manager/businesses//invoices//transactions/`. While an Invoice is in the “Processing” state and a relevant crypto payment processor has been selected such as “native_bitcoin” pole the above endpoint until an non-empty array is returned. @@ -101,8 +101,3 @@ An example of a request with transactions: ``` Within the `metadata` field of the transaction object the relevant payment processor, in this case Bitcoin, will include a section such as `service_bitcoin` that contains both the confirmations and the Bitcoin transaction hash(tx_hash field). When a `Pending` transaction exists in this array both the hash and the confirmations with a message such as “You payment has been detected with confirmations is currently waiting to be confirmed.” - - - - - diff --git a/content/checkout/custom-integration/payments.md b/content/checkout/custom-integration/payments.md index 1528d9e..c39ec2e 100644 --- a/content/checkout/custom-integration/payments.md +++ b/content/checkout/custom-integration/payments.md @@ -30,19 +30,9 @@ The only piece of information required from the user is a valid email address to Once the user has made their choice and entered an email address your backend or front-end should update the Invoice object by PATCHing the `primary_payment_processor` field with the `unique_string_name` of the payment processor using the anonymous endpoint like so: ``` -curl -X PATCH "/api/requests//" +curl -X PATCH "{{}}/api/requests//" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \"primary_payment_processor\": "native_otp"}" ``` -Note: because this is an anonymous endpoint either the front or backend can call it but it has very limited interaction but it does allow for the selecting of a payment method. The `/manager/businesses/{business_id}/invoices/{invoice_id}/` endpoint can always be used with a valid authentication token for any other updates required to be made to the invoice. - - - - - - - - - - +Note: because this is an anonymous endpoint either the front or backend can call it but it has very limited interaction but it does allow for the selecting of a payment method. The `{{}}/api/manager/businesses/{business_id}/invoices/{invoice_id}/` endpoint can always be used with a valid authentication token for any other updates required to be made to the invoice. diff --git a/content/checkout/custom-integration/webhooks.md b/content/checkout/custom-integration/webhooks.md index a006d33..17e6ac2 100644 --- a/content/checkout/custom-integration/webhooks.md +++ b/content/checkout/custom-integration/webhooks.md @@ -72,13 +72,3 @@ After being set up a Webhook will be sent each time the Invoice has a Status cha The most relevant field is the `status` field. On successful payment this will be updated to the `paid` state. Once your service receives a webhook with the `paid` status any orders made by the user can be completed on your third party e-commerce platform. Another new field is the `payment_processor_quotes` array. This will contain a list of methods chosen by the user to make the payment. It can be used to check what currencies your users are paying or if they over/underpaid and by what amount. - - - - - - - - - - diff --git a/content/checkout/hosted-payments-page/invoicing.md b/content/checkout/hosted-payments-page/invoicing.md index 6ec0a6e..fd9c757 100644 --- a/content/checkout/hosted-payments-page/invoicing.md +++ b/content/checkout/hosted-payments-page/invoicing.md @@ -20,7 +20,7 @@ The first step to initiate the payment process is to create an invoice. This wou ### Endpoints URL | methods ---|--- -`​/manager​/businesses​/{business_id}​/invoices​/` | `POST` +`​{{}}/api/manager​/businesses​/{business_id}​/invoices​/` | `POST` ### Example data: ``` @@ -72,16 +72,6 @@ In the case where an invoice is no longer valid the status can be PATCH’d usin ### Endpoints URL | methods ---|--- -`​/manager​/businesses​/{business_id}​/invoices​/` | `PATCH` +`​{{}}/api/manager​/businesses​/{business_id}​/invoices​/` | `PATCH` PATCH the endpoint with the new `cancelled` status and this will stop the user from viewing/interacting with the invoice. - - - - - - - - - - diff --git a/content/checkout/hosted-payments-page/overview.md b/content/checkout/hosted-payments-page/overview.md index a827e4f..17d2832 100644 --- a/content/checkout/hosted-payments-page/overview.md +++ b/content/checkout/hosted-payments-page/overview.md @@ -14,10 +14,3 @@ The hosted option allows for minimal integration to get started with receiving p 3. The customer is redirected to the hosted page which handles the selection and display of payment options 4. Once the payment has been processed the hosted payments page will redirect the user back if specified 5. A webhook is sent to any relevant services when the Invoice has been completed. - - - - - - - diff --git a/content/checkout/hosted-payments-page/webhooks.md b/content/checkout/hosted-payments-page/webhooks.md index b40e4be..e953602 100644 --- a/content/checkout/hosted-payments-page/webhooks.md +++ b/content/checkout/hosted-payments-page/webhooks.md @@ -72,13 +72,3 @@ After being set up a Webhook will be sent each time the Invoice has a Status cha The most relevant field is the `status` field. On successful payment this will be updated to the `paid` state. Once your service receives a webhook with the `paid` status any orders made by the user can be completed on your third party e-commerce platform. Another new field is the `payment_processor_quotes` array. This will contain a list of methods chosen by the user to make the payment. It can be used to check what currencies your users are paying or if they over/underpaid and by what amount. - - - - - - - - - -