Skip to content

Commit

Permalink
Latest url changes
Browse files Browse the repository at this point in the history
  • Loading branch information
michailbrynard committed Apr 22, 2021
2 parents 67480b3 + 352468e commit bc53844
Show file tree
Hide file tree
Showing 13 changed files with 22 additions and 75 deletions.
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[submodule "themes/hexon-hugo-theme"]
path = themes/hexon-hugo-theme
<<<<<<< HEAD
url = [email protected]:OdinsPlasmaRifle/hexon-hugo-theme.git
=======
url = https://github.com/OdinsPlasmaRifle/hexon-hugo-theme.git
>>>>>>> 352468ee464880e3a784cf2ad787f278d79c94a6
4 changes: 3 additions & 1 deletion config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -21,4 +23,4 @@ params:

extraFooterItems:
- title: Log in
url: https://wallet.example.com
url: https://wallet.example.com
2 changes: 1 addition & 1 deletion content/checkout/_index.md
Original file line number Diff line number Diff line change
@@ -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
---
2 changes: 1 addition & 1 deletion content/checkout/core-resources/invoice.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ cancelled | The invoice has been set to cancelled by a manager.
"metadata": null,
"status": "overpaid",
"account": null,
"redirect_url": "<domain>?request=deb62287-dbc6-4f11-8f83-d753f6cf1284",
"redirect_url": "{{param appUrl}}?request=deb62287-dbc6-4f11-8f83-d753f6cf1284",
"payer_email": "[email protected]",
"return_url": null,
"payment_processor_quotes": [
Expand Down
2 changes: 1 addition & 1 deletion content/checkout/core-resources/payment-processor.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
13 changes: 3 additions & 10 deletions content/checkout/custom-integration/closed-loop.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/<invoice-id>/" -H "accept: application/json"
curl -X PATCH "{{<param invoicesApi>}}/api/requests/<invoice-id>/" -H "accept: application/json"
-H "Content-Type: application/json"
-d "{ \"payer_email\": \"[email protected]\", \"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/<business_id>/invoice/<invoice-id>/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: `{{<param invoicesAPI>}}/api/manager/businesses/<business_id>/invoice/<invoice-id>/otp-challenge/` as follows:
```
curl -X POST "/requests/<invoice-id>/otp_challenge/"
curl -X POST "{{param invoicesApi}}/requests/<invoice-id>/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.







6 changes: 3 additions & 3 deletions content/checkout/custom-integration/invoicing.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
```
Expand Down Expand Up @@ -54,7 +54,7 @@ URL | methods
"description": "Online payment for clothes",
"status": "initiated",
"return_url": "https://my-ecommerce-store.com/order/<USER_ORDER_PAGE>",
"redirect_url": "https://<company-specified-invoice-url>.com/?request=e7d7a5a2-9a97-4930-a992-589a6133488f&return_url=https://my-ecommerce-store.com/order/<USER_ORDER_PAGE>",
"redirect_url": "https://{{params appUrl}}.com/?request=e7d7a5a2-9a97-4930-a992-589a6133488f&return_url=https://my-ecommerce-store.com/order/<USER_ORDER_PAGE>",
"payment_processor_quotes": [],
"created": 0,
"updated": 0
Expand All @@ -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`
`{{<param businessApi>}}/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.

Expand Down
9 changes: 2 additions & 7 deletions content/checkout/custom-integration/open-loop.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/<business_id>/invoices/<invoice-id>/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/<business_id>/invoices/<invoice-id>/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.
Expand All @@ -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/<business_id>/invoices/<invoice-id>/transactions/`.
To display this information you will use the transactions endpoint of the invoice: `{{<param businessApi>}}/api/manager/businesses/<business_id>/invoices/<invoice-id>/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.

Expand Down Expand Up @@ -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 <tx_hash> with <confirmations> confirmations is currently waiting to be confirmed.”





14 changes: 2 additions & 12 deletions content/checkout/custom-integration/payments.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/<request_id>/"
curl -X PATCH "{{<param invoicesApi>}}/api/requests/<request_id>/"
-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 `{{<param businessApi>}}/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.
10 changes: 0 additions & 10 deletions content/checkout/custom-integration/webhooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.










14 changes: 2 additions & 12 deletions content/checkout/hosted-payments-page/invoicing.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
`{{<param businessApi>}}/api/manager​/businesses​/{business_id}​/invoices​/` | `POST`

### Example data:
```
Expand Down Expand Up @@ -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`
`{{<param businessApi>}}/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.










7 changes: 0 additions & 7 deletions content/checkout/hosted-payments-page/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.







10 changes: 0 additions & 10 deletions content/checkout/hosted-payments-page/webhooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.










0 comments on commit bc53844

Please sign in to comment.