Skip to content

Commit 56e1089

Browse files
bassgetagitbook-bot
authored andcommitted
GITBOOK-159: Fix cross chain docs to use v2 OpenAPI docs
1 parent c56ab96 commit 56e1089

1 file changed

Lines changed: 24 additions & 24 deletions

File tree

docs/request-network-api/crosschain-payments.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Crosschain payments are supported on the following blockchain networks:
3232
## Supported Stablecoins
3333

3434
{% hint style="warning" %}
35-
**Warning:** Crosschain payments work only with mainnet funds (real money). Test networks are not supported.
35+
**Warning:** Crosschain payments work only with mainnet funds (real money). Test networks are not supported.
3636
{% endhint %}
3737

3838
The following stablecoins are supported for crosschain payments on both the sending and receiving networks.
@@ -47,14 +47,14 @@ The following stablecoins are supported for crosschain payments on both the send
4747

4848
To enable crosschain payments, the request must be created with the following parameters:
4949

50-
* `paymentCurrency` included in the [#supported-stablecoins](crosschain-payments.md#supported-stablecoins "mention") and [#supported-networks](crosschain-payments.md#supported-networks "mention"). 
50+
* `paymentCurrency` included in the [#supported-stablecoins](crosschain-payments.md#supported-stablecoins "mention") and [#supported-networks](crosschain-payments.md#supported-networks "mention").
5151
* `amount` greater than 1 - _executing_ crosschain payments under 1 stablecoins is not allowed, even though _creating_ requests has no restrictions on `amount` .
5252

53-
For more details about creating requests, please see the [#v1-request](create-and-pay-requests.md#v1-request "mention") endpoint.
53+
For more details about creating requests, please see the [#post-v2-request](create-and-pay-requests.md#post-v2-request "mention") endpoint.
5454

5555
### 2. Payment route fetching
5656

57-
To display a list of possible routes for a given request and payer address, use the [#v1-request-paymentreference-routes](crosschain-payments.md#v1-request-paymentreference-routes "mention") endpoint. It returns all of the possible routes based on the payer's token balances. 
57+
To display a list of possible routes for a given request and payer address, use the [#get-v2-request-requestid-routes](crosschain-payments.md#get-v2-request-requestid-routes "mention") endpoint. It returns all of the possible routes based on the payer's token balances.
5858

5959
#### Route Ranking
6060

@@ -73,19 +73,19 @@ When fetching payment routes, each route displays the total estimated fees in th
7373

7474
The total fee includes all gas costs incurred by the payment processor wallet for processing the transaction. This covers:
7575

76-
  \- Transferring tokens from the payer's wallet.
76+
\- Transferring tokens from the payer's wallet.
7777

78-
  \- Approving the payment execution smart contract.
78+
\- Approving the payment execution smart contract.
7979

80-
  \- Executing the crosschain payment transaction.
80+
\- Executing the crosschain payment transaction.
8181

8282
**For tokens supporting EIP-2612:**
8383

84-
  \- The payment processor wallet also covers for the onchain permit transaction.
84+
\- The payment processor wallet also covers for the onchain permit transaction.
8585

8686
**For tokens that do not support EIP-2612:**
8787

88-
  \- The payer must perform an onchain approval transaction and pay for the gas fee directly. This fee is **not** included in the total fee shown for the route.
88+
\- The payer must perform an onchain approval transaction and pay for the gas fee directly. This fee is **not** included in the total fee shown for the route.
8989
2. **Service Fees:**
9090

9191
The total fees also include any service fees charged by the crosschain infrastructure for facilitating transfers or swaps between different blockchains.
@@ -95,28 +95,28 @@ When fetching payment routes, each route displays the total estimated fees in th
9595
The API may return samechain routes if the payer address has supported currencies on the same chain as the `paymentCurrency` .
9696

9797
* Example: `paymentCurrency` is USDC on Base, and the payer has USDT on Base
98-
* Gassless transactions - the transaction fees are added on top of the request amount
98+
* Gasless transactions - the transaction fees are added on top of the request amount
9999
* No native token (ETH, etc..) needed for gas
100100

101-
{% openapi src="https://api.stage.request.network/open-api/openapi.json" path="/v1/request/{paymentReference}/routes" method="get" %}
102-
[https://api.stage.request.network/open-api/openapi.json](https://api.stage.request.network/open-api/openapi.json)
103-
{% endopenapi %}
101+
{% openapi-operation spec="request-api" path="/v2/request/{requestId}/routes" method="get" %}
102+
[Broken link](broken-reference)
103+
{% endopenapi-operation %}
104104

105105
### 3. Getting payment calldata
106106

107107
Once the route is selected, the payer needs to fetch the unsigned payment calldata or intents.\
108108
\
109-
If the selected route is a crosschain payment, the [#v1-request-paymentreference-pay](crosschain-payments.md#v1-request-paymentreference-pay "mention") endpoint returns an unsigned payment intent. It will also return an unsigned approval permit or unsigned approval calldata, depending on whether the `paymentCurrency` supports [EIP-2612 Permit](https://eips.ethereum.org/EIPS/eip-2612). For crosschain payments, this endpoint is NOT approval aware - it will return an approval permit or approval calldata even if approval has already been granted.
109+
If the selected route is a crosschain payment, the [#get-v2-request-requestid-pay](crosschain-payments.md#get-v2-request-requestid-pay "mention") endpoint returns an unsigned payment intent. It will also return an unsigned approval permit or unsigned approval calldata, depending on whether the `paymentCurrency` supports [EIP-2612 Permit](https://eips.ethereum.org/EIPS/eip-2612). For crosschain payments, this endpoint is NOT approval aware - it will return an approval permit or approval calldata even if approval has already been granted.
110110

111-
If the selected route is a direct payment, the [#v1-request-paymentreference-pay](crosschain-payments.md#v1-request-paymentreference-pay "mention") returns an unsigned payment calldata. It may also return an approval calldata. For direct payments, this endpoint IS approval aware - it will omit the approval calldata if sufficient approval has already been granted.
111+
If the selected route is a direct payment, the [#get-v2-request-requestid-pay](crosschain-payments.md#get-v2-request-requestid-pay "mention") returns an unsigned payment calldata. It may also return an approval calldata. For direct payments, this endpoint IS approval aware - it will omit the approval calldata if sufficient approval has already been granted.
112112

113-
{% openapi src="https://api.stage.request.network/open-api/openapi.json" path="/v1/request/{paymentReference}/pay" method="get" %}
114-
[https://api.stage.request.network/open-api/openapi.json](https://api.stage.request.network/open-api/openapi.json)
115-
{% endopenapi %}
113+
{% openapi-operation spec="request-api" path="/v2/request/{requestId}/pay" method="get" %}
114+
[Broken link](broken-reference)
115+
{% endopenapi-operation %}
116116

117117
### 4. Signing the payment intent
118118

119-
The intents and calldata returned by the [#v1-request-paymentreference-pay](crosschain-payments.md#v1-request-paymentreference-pay "mention") endpoint in the previous step must be signed by the payer's wallet to authorize the crosschain payment. The process for signing the approval varies depending on whether the `paymentCurrency` supports [EIP-2612 Permit](https://eips.ethereum.org/EIPS/eip-2612), indicated by the `metadata` response parameter.
119+
The intents and calldata returned by the [#get-v2-request-requestid-pay](crosschain-payments.md#get-v2-request-requestid-pay "mention") endpoint in the previous step must be signed by the payer's wallet to authorize the crosschain payment. The process for signing the approval varies depending on whether the `paymentCurrency` supports [EIP-2612 Permit](https://eips.ethereum.org/EIPS/eip-2612), indicated by the `metadata` response parameter.
120120

121121
```json
122122
"metadata": {
@@ -137,7 +137,7 @@ const ethersProvider = new ethers.providers.Web3Provider(
137137
);
138138
const signer = await ethersProvider.getSigner();
139139

140-
// Response from the `GET /request/{paymentReference}/pay` endpoint
140+
// Response from the `GET /request/{requestId}/pay` endpoint
141141
const response = ...
142142

143143
const paymentIntent = JSON.parse(paymentData.paymentIntent);
@@ -186,11 +186,11 @@ const signedData = {
186186

187187
### 5. Sending the signed data
188188

189-
Finally, the signed payment intent (and possibly the signed approval permit) are sent back to execute the crosschain payment via the [#v1-request-paymentintentid-send](crosschain-payments.md#v1-request-paymentintentid-send "mention") endpoint. It will handle all the necessary steps to complete the payment. A `payment.complete` event will be sent to the platform's webhooks when the payment is completed.
189+
Finally, the signed payment intent (and possibly the signed approval permit) are sent back to execute the crosschain payment via the [#post-v2-request-payment-intents-paymentintentid](crosschain-payments.md#post-v2-request-payment-intents-paymentintentid "mention") endpoint. It will handle all the necessary steps to complete the payment. A `payment.complete` event will be sent to the platform's webhooks when the payment is completed.
190190

191-
{% openapi src="https://api.stage.request.network/open-api/openapi.json" path="/v1/request/{paymentIntentId}/send" method="post" %}
192-
[https://api.stage.request.network/open-api/openapi.json](https://api.stage.request.network/open-api/openapi.json)
193-
{% endopenapi %}
191+
{% openapi-operation spec="request-api" path="/v2/request/payment-intents/{paymentIntentId}" method="post" %}
192+
[Broken link](broken-reference)
193+
{% endopenapi-operation %}
194194

195195
## Custom fee configuration
196196

0 commit comments

Comments
 (0)