Skip to content

Commit

Permalink
#5 note how to debug payment callbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
skoro committed Sep 28, 2024
1 parent 961debc commit c746089
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,37 @@ The request will contain json data like this:
}
}
```

## How to debug payment gateway callbacks

In order to debug payment gateway callback responses, [expose](https://expose.dev/) tool can be used to create a tunnel
to your local development environment.
If you use docker, start `expose` with the following command:
```shell
expose share http://localhost
```

You will see external _Public HTTP_ and _Public HTTPS_ urls in output.
Use one of those urls and send Create Order request like this:
```
curl --location 'https://okdfskdfj126722jsnxz.sharedwithexpose.com/api/v1/order' \
--header 'Content-Type: application/json' \
--data '{
"order_num": "00001",
"payment_gateway": "liqpay",
"description": "Order #001",
"return_url": "https://super-site.com/thank-you",
"products": [
{
"sku": "A01001",
"price": 1900,
"qty": 1,
"name": "Beer"
}
]
}'
```
Make sure `status_check` in the response has an external url,
that means your host is shared and the payment gateway will send a callback via the external url.
If you still have localhost, check `trusted_proxies` settings in `config/packages/framework.yaml`.

0 comments on commit c746089

Please sign in to comment.