From c22aa3e150d6f8b4abf6336be595d49f4ef69121 Mon Sep 17 00:00:00 2001 From: Adrian Boros Date: Tue, 25 Nov 2025 12:55:42 +0200 Subject: [PATCH 1/5] feat(docs): add local php snippets, updated docs --- docs/src/content/docs/sdk/grant-continue.mdx | 17 ++++-- .../docs/sdk/grant-create-incoming.mdx | 23 +++++--- .../docs/sdk/grant-create-outgoing.mdx | 25 ++++---- .../content/docs/sdk/grant-create-quote.mdx | 20 ++++--- docs/src/content/docs/sdk/grant-revoke.mdx | 5 +- .../content/docs/sdk/incoming-complete.mdx | 10 ++-- docs/src/content/docs/sdk/incoming-create.mdx | 6 +- docs/src/content/docs/sdk/incoming-get.mdx | 15 +++-- docs/src/content/docs/sdk/incoming-list.mdx | 15 +++-- docs/src/content/docs/sdk/outgoing-create.mdx | 15 +++-- docs/src/content/docs/sdk/outgoing-get.mdx | 10 ++-- docs/src/content/docs/sdk/outgoing-list.mdx | 10 ++-- docs/src/content/docs/sdk/quote-create.mdx | 45 +++++++++------ docs/src/content/docs/sdk/quote-get.mdx | 10 ++-- docs/src/content/docs/sdk/token-revoke.mdx | 5 +- docs/src/content/docs/sdk/token-rotate.mdx | 10 ++-- docs/src/content/docs/sdk/wallet-get-info.mdx | 20 ++++++- docs/src/content/docs/sdk/wallet-get-keys.mdx | 23 ++++++-- docs/src/partials/php-import-initialize.mdx | 9 ++- snippets/php/grant/grant-continuation.php | 25 ++++++++ snippets/php/grant/grant-incoming-payment.php | 36 ++++++++++++ .../grant/grant-outgoing-payment-interval.php | 37 ++++++++++++ snippets/php/grant/grant-outgoing-payment.php | 57 +++++++++++++++++++ snippets/php/grant/grant-quote.php | 39 +++++++++++++ snippets/php/grant/grant-revoke.php | 10 ++++ .../incoming-payment-complete.php | 14 +++++ .../incoming-payment-create.php | 42 ++++++++++++++ .../incoming-payment-get-public.php | 9 +++ .../incoming-payment/incoming-payment-get.php | 14 +++++ .../incoming-payment-list.php | 25 ++++++++ .../outgoing-payment-create.php | 55 ++++++++++++++++++ .../outgoing-payment/outgoing-payment-get.php | 14 +++++ .../outgoing-payment-list.php | 22 +++++++ .../php/quote/quote-create-debit-amount.php | 31 ++++++++++ .../php/quote/quote-create-receive-amount.php | 30 ++++++++++ snippets/php/quote/quote-create.php | 24 ++++++++ snippets/php/quote/quote-get.php | 19 +++++++ snippets/php/token/token-revoke.php | 10 ++++ snippets/php/token/token-rotate.php | 15 +++++ .../wallet-address-get-keys.php | 21 +++++++ .../php/wallet-address/wallet-address-get.php | 21 +++++++ 41 files changed, 760 insertions(+), 103 deletions(-) create mode 100644 snippets/php/grant/grant-continuation.php create mode 100644 snippets/php/grant/grant-incoming-payment.php create mode 100644 snippets/php/grant/grant-outgoing-payment-interval.php create mode 100644 snippets/php/grant/grant-outgoing-payment.php create mode 100644 snippets/php/grant/grant-quote.php create mode 100644 snippets/php/grant/grant-revoke.php create mode 100644 snippets/php/incoming-payment/incoming-payment-complete.php create mode 100644 snippets/php/incoming-payment/incoming-payment-create.php create mode 100644 snippets/php/incoming-payment/incoming-payment-get-public.php create mode 100644 snippets/php/incoming-payment/incoming-payment-get.php create mode 100644 snippets/php/incoming-payment/incoming-payment-list.php create mode 100644 snippets/php/outgoing-payment/outgoing-payment-create.php create mode 100644 snippets/php/outgoing-payment/outgoing-payment-get.php create mode 100644 snippets/php/outgoing-payment/outgoing-payment-list.php create mode 100644 snippets/php/quote/quote-create-debit-amount.php create mode 100644 snippets/php/quote/quote-create-receive-amount.php create mode 100644 snippets/php/quote/quote-create.php create mode 100644 snippets/php/quote/quote-get.php create mode 100644 snippets/php/token/token-revoke.php create mode 100644 snippets/php/token/token-rotate.php create mode 100644 snippets/php/wallet-address/wallet-address-get-keys.php create mode 100644 snippets/php/wallet-address/wallet-address-get.php diff --git a/docs/src/content/docs/sdk/grant-continue.mdx b/docs/src/content/docs/sdk/grant-continue.mdx index 7203677f..5730a2f6 100644 --- a/docs/src/content/docs/sdk/grant-continue.mdx +++ b/docs/src/content/docs/sdk/grant-continue.mdx @@ -97,16 +97,21 @@ For JavaScript, run `node path/to/directory/index.js`. + + {/* prettier-ignore */} diff --git a/docs/src/content/docs/sdk/grant-create-incoming.mdx b/docs/src/content/docs/sdk/grant-create-incoming.mdx index 13f1902e..32b457a7 100644 --- a/docs/src/content/docs/sdk/grant-create-incoming.mdx +++ b/docs/src/content/docs/sdk/grant-create-incoming.mdx @@ -105,22 +105,27 @@ For JavaScript, run `node path/to/directory/index.js`. + */} + source='grant/grant-incoming-payment.php' + l='php' + chunk='4' +/> {/* prettier-ignore */}

View full source

diff --git a/docs/src/content/docs/sdk/grant-create-outgoing.mdx b/docs/src/content/docs/sdk/grant-create-outgoing.mdx index 34d68804..29d17333 100644 --- a/docs/src/content/docs/sdk/grant-create-outgoing.mdx +++ b/docs/src/content/docs/sdk/grant-create-outgoing.mdx @@ -119,31 +119,36 @@ For JavaScript, run `node path/to/directory/index.js`. #### Generate without an interval #### Generate with an interval {/* prettier-ignore */} diff --git a/docs/src/content/docs/sdk/grant-create-quote.mdx b/docs/src/content/docs/sdk/grant-create-quote.mdx index 5daf8c2a..83bedefc 100644 --- a/docs/src/content/docs/sdk/grant-create-quote.mdx +++ b/docs/src/content/docs/sdk/grant-create-quote.mdx @@ -105,20 +105,24 @@ For JavaScript, run `node path/to/directory/index.js`. {/* prettier-ignore */} diff --git a/docs/src/content/docs/sdk/grant-revoke.mdx b/docs/src/content/docs/sdk/grant-revoke.mdx index 3ca66419..0835f0d7 100644 --- a/docs/src/content/docs/sdk/grant-revoke.mdx +++ b/docs/src/content/docs/sdk/grant-revoke.mdx @@ -73,8 +73,9 @@ For JavaScript, run `node path/to/directory/index.js`. {/* prettier-ignore */}

View full source

diff --git a/docs/src/content/docs/sdk/incoming-complete.mdx b/docs/src/content/docs/sdk/incoming-complete.mdx index e70c79b8..c31cba64 100644 --- a/docs/src/content/docs/sdk/incoming-complete.mdx +++ b/docs/src/content/docs/sdk/incoming-complete.mdx @@ -85,12 +85,14 @@ For JavaScript, run `node path/to/directory/index.js`. {/* prettier-ignore */}

View full source

diff --git a/docs/src/content/docs/sdk/incoming-create.mdx b/docs/src/content/docs/sdk/incoming-create.mdx index 8b819281..412503fc 100644 --- a/docs/src/content/docs/sdk/incoming-create.mdx +++ b/docs/src/content/docs/sdk/incoming-create.mdx @@ -91,11 +91,13 @@ For JavaScript, run `node path/to/directory/index.js`. {/* prettier-ignore */} diff --git a/docs/src/content/docs/sdk/incoming-get.mdx b/docs/src/content/docs/sdk/incoming-get.mdx index b3cb59ac..9e33594b 100644 --- a/docs/src/content/docs/sdk/incoming-get.mdx +++ b/docs/src/content/docs/sdk/incoming-get.mdx @@ -114,20 +114,23 @@ For JavaScript, run `node path/to/directory/index.js`. #### Get without authentication {/* prettier-ignore */}

View full source with authentication

diff --git a/docs/src/content/docs/sdk/incoming-list.mdx b/docs/src/content/docs/sdk/incoming-list.mdx index 07284470..fec1bd01 100644 --- a/docs/src/content/docs/sdk/incoming-list.mdx +++ b/docs/src/content/docs/sdk/incoming-list.mdx @@ -85,16 +85,19 @@ For JavaScript, run `node path/to/directory/index.js`. {/* prettier-ignore */}

View full source

diff --git a/docs/src/content/docs/sdk/outgoing-create.mdx b/docs/src/content/docs/sdk/outgoing-create.mdx index 5b6b2be0..4c5d173b 100644 --- a/docs/src/content/docs/sdk/outgoing-create.mdx +++ b/docs/src/content/docs/sdk/outgoing-create.mdx @@ -95,20 +95,23 @@ For JavaScript, run `node path/to/directory/index.js`. #### With amount {/* prettier-ignore */}

View full source without amount

diff --git a/docs/src/content/docs/sdk/outgoing-get.mdx b/docs/src/content/docs/sdk/outgoing-get.mdx index d6c73736..bf14ee9b 100644 --- a/docs/src/content/docs/sdk/outgoing-get.mdx +++ b/docs/src/content/docs/sdk/outgoing-get.mdx @@ -85,12 +85,14 @@ For JavaScript, run `node path/to/directory/index.js`. {/* prettier-ignore */}

View full source

diff --git a/docs/src/content/docs/sdk/outgoing-list.mdx b/docs/src/content/docs/sdk/outgoing-list.mdx index 37904e21..5341ce19 100644 --- a/docs/src/content/docs/sdk/outgoing-list.mdx +++ b/docs/src/content/docs/sdk/outgoing-list.mdx @@ -85,12 +85,14 @@ For JavaScript, run `node path/to/directory/index.js`. {/* prettier-ignore */}

View full source

diff --git a/docs/src/content/docs/sdk/quote-create.mdx b/docs/src/content/docs/sdk/quote-create.mdx index 05e0cde1..50292428 100644 --- a/docs/src/content/docs/sdk/quote-create.mdx +++ b/docs/src/content/docs/sdk/quote-create.mdx @@ -87,14 +87,18 @@ For JavaScript, run `node path/to/directory/index.js`. Prerequisites + + {/* prettier-ignore */}

View full source

@@ -173,17 +177,21 @@ For JavaScript, run `node path/to/directory/index.js`. Prerequisites + {/* prettier-ignore */}

View full source

@@ -261,18 +269,23 @@ For JavaScript, run `node path/to/directory/index.js`. Prerequisites + + {/* prettier-ignore */}

View full source

diff --git a/docs/src/content/docs/sdk/quote-get.mdx b/docs/src/content/docs/sdk/quote-get.mdx index 4ca2ff00..20689dfc 100644 --- a/docs/src/content/docs/sdk/quote-get.mdx +++ b/docs/src/content/docs/sdk/quote-get.mdx @@ -87,12 +87,14 @@ For JavaScript, run `node path/to/directory/index.js`. {/* prettier-ignore */}

View full source

diff --git a/docs/src/content/docs/sdk/token-revoke.mdx b/docs/src/content/docs/sdk/token-revoke.mdx index 9dd3f5da..c3fcf71b 100644 --- a/docs/src/content/docs/sdk/token-revoke.mdx +++ b/docs/src/content/docs/sdk/token-revoke.mdx @@ -79,8 +79,9 @@ For JavaScript, run `node path/to/directory/index.js`. {/* prettier-ignore */}

View full source

diff --git a/docs/src/content/docs/sdk/token-rotate.mdx b/docs/src/content/docs/sdk/token-rotate.mdx index 1723c6e5..5ef2cb84 100644 --- a/docs/src/content/docs/sdk/token-rotate.mdx +++ b/docs/src/content/docs/sdk/token-rotate.mdx @@ -87,12 +87,14 @@ For JavaScript, run `node path/to/directory/index.js`. {/* prettier-ignore */}

View full source

diff --git a/docs/src/content/docs/sdk/wallet-get-info.mdx b/docs/src/content/docs/sdk/wallet-get-info.mdx index 2e986468..33c12fc2 100644 --- a/docs/src/content/docs/sdk/wallet-get-info.mdx +++ b/docs/src/content/docs/sdk/wallet-get-info.mdx @@ -80,13 +80,29 @@ For JavaScript, run `node path/to/directory/index.js`. + + + + + + {/* prettier-ignore */}

View full source

diff --git a/docs/src/content/docs/sdk/wallet-get-keys.mdx b/docs/src/content/docs/sdk/wallet-get-keys.mdx index 2c6a2c26..3951206c 100644 --- a/docs/src/content/docs/sdk/wallet-get-keys.mdx +++ b/docs/src/content/docs/sdk/wallet-get-keys.mdx @@ -8,8 +8,7 @@ import ChunkedSnippet from '/src/components/ChunkedSnippet.astro' import Begin from '/src/partials/before-you-begin.mdx' import Ts from '/src/partials/ts-init-config.mdx' import TsImport from '/src/partials/ts-import-initialize.mdx' -import PhpImport from '/src/partials/php-import-initialize.mdx' - + While most Open Payments code snippets are intended for clients, getting the keys bound to a wallet address is primarily a function of account servicing entities. When an authorization server receives a signed grant request, the server can make a call to acquire the public keys bound to the wallet address. Then, when a client makes a request to a resource server, the resource server calls the auth server to ensure the signature of the request corresponds to the public JWK of the wallet address. This enables the server to ensure the client is who it says it is. @@ -85,16 +84,30 @@ For JavaScript, run `node path/to/directory/index.js`. Prerequisites - + + + + + {/* prettier-ignore */}

View full source

diff --git a/docs/src/partials/php-import-initialize.mdx b/docs/src/partials/php-import-initialize.mdx index 8eb0de37..c5aaebe1 100644 --- a/docs/src/partials/php-import-initialize.mdx +++ b/docs/src/partials/php-import-initialize.mdx @@ -1,10 +1,13 @@ import ChunkedSnippet from '/src/components/ChunkedSnippet.astro' + +/> \ No newline at end of file diff --git a/snippets/php/grant/grant-continuation.php b/snippets/php/grant/grant-continuation.php new file mode 100644 index 00000000..53df5650 --- /dev/null +++ b/snippets/php/grant/grant-continuation.php @@ -0,0 +1,25 @@ +grant()->continue( + [ + 'access_token' => $CONTINUE_ACCESS_TOKEN, + 'url' => $CONTINUE_URI + ], + [ + 'interact_ref' => $interactRef, + ] +); +//@! end chunk 1 + +//@! start chunk 2 | title=Check grant state +if (!$grant instanceof \OpenPayments\Models\Grant) { + throw new \Error('Expected finalized grant. Received non-finalized grant.'); +} +//@! end chunk 2 + +//@! start chunk 3 | title=Output +echo 'OUTGOING_PAYMENT_GRANT_ACCES_TOKEN: ' . $grant->access_token->value . PHP_EOL; +echo 'OUTGOING_PAYMENT_ACCESS_TOKEN_MANAGE_URL: ' . $grant->access_token->manage . PHP_EOL; +echo 'GRANT OBJECT: ' . PHP_EOL . print_r($grant, true); +//@! end chunk 3 diff --git a/snippets/php/grant/grant-incoming-payment.php b/snippets/php/grant/grant-incoming-payment.php new file mode 100644 index 00000000..865fd9c7 --- /dev/null +++ b/snippets/php/grant/grant-incoming-payment.php @@ -0,0 +1,36 @@ +walletAddress()->get([ + 'url' => $config->getWalletAddressUrl() +]); +//@! end chunk 1 +//@! start chunk 2 | title=Request incoming payment grant +$grant = $opClient->grant()->request( + [ + 'url' => $wallet->authServer + ], + [ + 'access_token' => [ + 'access' => [ + [ + 'type' => 'incoming-payment', + 'actions' => ['read', 'complete', 'create', 'list'] + ] + ] + ] + ] +); +//@! end chunk 2 + +//@! start chunk 3 | title=Check grant state +if (!$grant instanceof \OpenPayments\Models\Grant) { + throw new \Error('Expected non-interactive grant'); +} +//@! end chunk 3 + +//@! start chunk 4 | title=Output +echo 'INCOMING_PAYMENT_GRANT: ' . $grant->access_token->value . PHP_EOL; +echo "INCOMING_PAYMENT_ACCESS_TOKEN_MANAGE_URL = " . $grant->access_token->manage . PHP_EOL; +echo 'GRANT OBJECT: ' . PHP_EOL . print_r($grant, true); +//@! end chunk 4 diff --git a/snippets/php/grant/grant-outgoing-payment-interval.php b/snippets/php/grant/grant-outgoing-payment-interval.php new file mode 100644 index 00000000..00254e29 --- /dev/null +++ b/snippets/php/grant/grant-outgoing-payment-interval.php @@ -0,0 +1,37 @@ +grant()->request( + [ + 'url' => $wallet->authServer + ], + [ + 'access_token' => [ + 'access' => [ + [ + 'type' => 'outgoing-payment', + 'actions' => ['list', 'list-all', 'read', 'read-all', 'create'], + 'identifier' => $wallet->id, + 'limits' => [ + 'debitAmount' => [ + 'assetCode' => 'USD', + 'assetScale' => 2, + 'value' => "132", + ], + 'interval' => 'R/2025-04-22T08:00:00Z/P1D', + ], + ] + ] + ], + 'client' => $config->getWalletAddressUrl(), + 'interact' => [ + 'start' => ["redirect"], + 'finish' => [ + 'method' => "redirect", + 'uri' => 'https://localhost/?paymentId=123423', + 'nonce' => "1234567890", + ], + ] + ] +); +//@! end chunk 1 diff --git a/snippets/php/grant/grant-outgoing-payment.php b/snippets/php/grant/grant-outgoing-payment.php new file mode 100644 index 00000000..d2b7ccef --- /dev/null +++ b/snippets/php/grant/grant-outgoing-payment.php @@ -0,0 +1,57 @@ +walletAddress()->get([ + 'url' => $config->getWalletAddressUrl() +]); +//@! end chunk 1 +// See https://openpayments.dev/apis/auth-server/operations/post-request/ + +//@! start chunk 2 | title=Request outgoing payment grant +$grant = $opClient->grant()->request( + [ + 'url' => $wallet->authServer + ], + [ + 'access_token' => [ + 'access' => [ + [ + 'type' => 'outgoing-payment', + 'actions' => ['list', 'list-all', 'read', 'read-all', 'create'], + 'identifier' => $wallet->id, + 'limits' => [ + 'receiver' => $INCOMING_PAYMENT_URL, //optional + 'debitAmount' => [ + 'assetCode' => 'USD', + 'assetScale' => 2, + 'value' => "130", + ] + ], + ] + ] + ], + 'client' => $config->getWalletAddressUrl(), + 'interact' => [ + 'start' => ["redirect"], + 'finish' => [ + 'method' => "redirect", + 'uri' => 'https://localhost/?paymentId=123423', + 'nonce' => "1234567890", + ], + ] + ] +); +//@! end chunk 2 + +//@! start chunk 3 | title=Check grant state +if (!$grant instanceof \OpenPayments\Models\PendingGrant) { + throw new \Error('Expected interactive grant'); +} +//@! end chunk 3 + +//@! start chunk 4 | title=Output +echo 'Please interact at the following URL: ' . $grant->interact->redirect . PHP_EOL; +echo 'CONTINUE_ACCESS_TOKEN = ' . $grant->continue->access_token->value . PHP_EOL; +echo 'CONTINUE_URI = ' . $grant->continue->uri . PHP_EOL; +echo 'GRANT OBJECT: ' . PHP_EOL . print_r($grant, true); +//@! end chunk 4 diff --git a/snippets/php/grant/grant-quote.php b/snippets/php/grant/grant-quote.php new file mode 100644 index 00000000..e35da871 --- /dev/null +++ b/snippets/php/grant/grant-quote.php @@ -0,0 +1,39 @@ +walletAddress()->get([ + 'url' => $config->getWalletAddressUrl() +]); +//@! end chunk 1 + +//@! start chunk 2 | title=Request quote grant +$grant = $opClient->grant()->request( + [ + 'url' => $wallet->authServer + ], + [ + 'access_token' => [ + 'access' => [ + [ + 'type' => 'quote', + 'actions' => ['create', 'read', 'read-all'] + ] + ] + ], + 'client' => $config->getWalletAddressUrl() + ] +); +//@! end chunk 2 + +//@! start chunk 3 | title=Check grant state + if ($grant instanceof \OpenPayments\Models\PendingGrant) { + throw new \Error('Expected non-interactive grant'); +} +//@! end chunk 3 + +//@! start chunk 4 | title=Output +echo 'QUOTE_ACCESS_TOKEN: ' . $grant->access_token->value . PHP_EOL; +echo 'QUOTE_ACCESS_TOKEN_MANAGE_URL: ' . $grant->access_token->manage . PHP_EOL; + +echo 'GRANT OBJECT: ' . PHP_EOL . print_r($grant, true); +//@! end chunk 4 diff --git a/snippets/php/grant/grant-revoke.php b/snippets/php/grant/grant-revoke.php new file mode 100644 index 00000000..21157794 --- /dev/null +++ b/snippets/php/grant/grant-revoke.php @@ -0,0 +1,10 @@ +grant()->cancel( + [ + 'access_token'=> $ACCESS_TOKEN, + 'url' => $CONTINUE_URI + ] +); +//@! end chunk 1 diff --git a/snippets/php/incoming-payment/incoming-payment-complete.php b/snippets/php/incoming-payment/incoming-payment-complete.php new file mode 100644 index 00000000..30f21c58 --- /dev/null +++ b/snippets/php/incoming-payment/incoming-payment-complete.php @@ -0,0 +1,14 @@ +incomingPayment()->complete( + [ + 'access_token' => $INCOMING_PAYMENT_GRANT_ACCESS_TOKEN, + 'url' => $INCOMING_PAYMENT_URL + ] +); +//@! end chunk 1 + +//@! start chunk 2 | title=Output +echo 'COMPLETE INCOMING PAYMENT: '. PHP_EOL . print_r($incomingPayment, true); +//@! end chunk 2 diff --git a/snippets/php/incoming-payment/incoming-payment-create.php b/snippets/php/incoming-payment/incoming-payment-create.php new file mode 100644 index 00000000..1bb47281 --- /dev/null +++ b/snippets/php/incoming-payment/incoming-payment-create.php @@ -0,0 +1,42 @@ +incomingPayment()->create( + [ + 'url' => $wallet->resourceServer, + 'access_token' => $INCOMING_PAYMENT_GRANT_ACCESS_TOKEN + ], + [ + 'walletAddress' => $config->getWalletAddressUrl(), + 'incomingAmount' => [ + 'value' => "130", + 'assetCode' => 'USD', + 'assetScale' => 2 + ], + 'metadata' => [ + 'description' => 'Test php snippets transaction with $1,30 amount', + 'externalRef' => 'INVOICE-' . uniqid() + ], + 'expiresAt' => (new \DateTime())->add(new \DateInterval('PT59M'))->format("Y-m-d\TH:i:s.v\Z") + ] +); +//@! end chunk 3 + +//@! start chunk 4 | title=Output +echo 'INCOMING_PAYMENT_URL: ' . $newIncomingPayment->id . PHP_EOL; +echo 'INCOMING PAYMENT OBJECT:' . PHP_EOL . print_r($newIncomingPayment, true); +//@! end chunk 4 diff --git a/snippets/php/incoming-payment/incoming-payment-get-public.php b/snippets/php/incoming-payment/incoming-payment-get-public.php new file mode 100644 index 00000000..d4e05cf7 --- /dev/null +++ b/snippets/php/incoming-payment/incoming-payment-get-public.php @@ -0,0 +1,9 @@ +incomingPayment()->get( + [ + 'url' => $INCOMING_PAYMENT_URL + ] +); +//@! end chunk 1 diff --git a/snippets/php/incoming-payment/incoming-payment-get.php b/snippets/php/incoming-payment/incoming-payment-get.php new file mode 100644 index 00000000..fcb1539a --- /dev/null +++ b/snippets/php/incoming-payment/incoming-payment-get.php @@ -0,0 +1,14 @@ +incomingPayment()->get( + [ + 'access_token' => $INCOMING_PAYMENT_GRANT_ACCESS_TOKEN, + 'url' => $INCOMING_PAYMENT_URL + ] +); +//@! end chunk 1 + +//@! start chunk 2 | title=Output +echo 'INCOMING PAYMENT: ' . PHP_EOL . print_r($incomingPayment, true); +//@! end chunk 2 diff --git a/snippets/php/incoming-payment/incoming-payment-list.php b/snippets/php/incoming-payment/incoming-payment-list.php new file mode 100644 index 00000000..0079a48e --- /dev/null +++ b/snippets/php/incoming-payment/incoming-payment-list.php @@ -0,0 +1,25 @@ +walletAddress()->get([ + 'url' => $config->getWalletAddressUrl() +]); +//@! end chunk 1 + +//@! start chunk 2 | title=List incoming payments +$incomingPaymentsList = $opClient->incomingPayment()->list( + [ + 'url' => $wallet->resourceServer, + 'access_token' => $INCOMING_PAYMENT_GRANT_ACCESS_TOKEN + ], + [ + 'wallet-address' => $config->getWalletAddressUrl(), + 'first' => 10, + 'start'=> '96d964f0-3421-4df0-bb04-cb8d653bc571' + ] +); +//@! end chunk 2 + +//@! start chunk 3 | title=Output +echo 'INCOMING PAYMENTS ' . PHP_EOL . print_r($incomingPaymentsList, true); +//@! end chunk 3 diff --git a/snippets/php/outgoing-payment/outgoing-payment-create.php b/snippets/php/outgoing-payment/outgoing-payment-create.php new file mode 100644 index 00000000..438533f0 --- /dev/null +++ b/snippets/php/outgoing-payment/outgoing-payment-create.php @@ -0,0 +1,55 @@ +outgoingPayment()->create( + [ + 'url' => $wallet->resourceServer, + 'access_token' => $OUTGOING_PAYMENT_GRANT_ACCESS_TOKEN + ], + [ + 'walletAddress' => $config->getWalletAddressUrl(), + 'quoteId' => $QUOTE_URL, + 'metadata' => [ + 'description' => 'Test outgoing payment', + 'reference' => '1234567890', + 'invoiceId' => '1234567890', + 'customData' => [ + 'key1' => 'value1', + 'key2' => 'value2' + ] + ], + ] +); +//@! end chunk 1 + +//@! start chunk 2 | title=Create outgoing payment with amount +$newOutgoingPayment = $opClient->outgoingPayment()->create( + [ + 'url' => $wallet->resourceServer, + 'access_token' => $OUTGOING_PAYMENT_GRANT_ACCESS_TOKEN + ], + [ + 'walletAddress' => $config->getWalletAddressUrl(), + 'incomingPayment' => $INCOMING_PAYMENT_URL, + 'debitAmount' => [ + 'value' => '9', + 'assetCode' => 'USD', + 'assetScale' => 2 + ], + 'metadata' => [ + 'description' => 'Test outgoing payment', + 'reference' => '1234567890', + 'invoiceId' => '1234567890', + 'customData' => [ + 'key1' => 'value1', + 'key2' => 'value2' + ] + ], + ] +); +//@! end chunk 2 + +//@! start chunk 3 | title=Output +echo 'OUTGOING_PAYMENT_URL: '.$newOutgoingPayment->id . PHP_EOL; +echo 'OUTGOING_PAYMENT OBJECT: ' . PHP_EOL . print_r($newOutgoingPayment, true) . PHP_EOL; +//@! end chunk 3 diff --git a/snippets/php/outgoing-payment/outgoing-payment-get.php b/snippets/php/outgoing-payment/outgoing-payment-get.php new file mode 100644 index 00000000..500dcce5 --- /dev/null +++ b/snippets/php/outgoing-payment/outgoing-payment-get.php @@ -0,0 +1,14 @@ +outgoingPayment()->get( + [ + 'access_token' => $OUTGOING_PAYMENT_GRANT_ACCESS_TOKEN, + 'url' => $OUTGOING_PAYMENT_URL + ] +); +//@! end chunk 1 + +//@! start chunk 2 | title=Output +echo 'OUTGOING PAYMENT: ' . PHP_EOL . print_r($outgoingPayment, true); +//@! end chunk 2 diff --git a/snippets/php/outgoing-payment/outgoing-payment-list.php b/snippets/php/outgoing-payment/outgoing-payment-list.php new file mode 100644 index 00000000..213faaff --- /dev/null +++ b/snippets/php/outgoing-payment/outgoing-payment-list.php @@ -0,0 +1,22 @@ +walletAddress()->get([ + 'url' => $config->getWalletAddressUrl() +]); + //@! start chunk 1 | title=List outgoing payments +$outgoingPaymentList = $opClient->outgoingPayment()->list( + [ + 'url' => $wallet->resourceServer, + 'access_token' => $OUTGOING_PAYMENT_GRANT_ACCESS_TOKEN + ], + [ + 'wallet-address' => $config->getWalletAddressUrl(), + 'first' => 3, + 'start' => '96d964f0-3421-4df0-bb04-cb8d653bc571' + ] +); +//@! end chunk 1 + +//@! start chunk 2 | title=Output +echo 'OUTGOING PAYMENTS LIST ' . PHP_EOL . print_r($outgoingPaymentList, true); +//@! end chunk 2 diff --git a/snippets/php/quote/quote-create-debit-amount.php b/snippets/php/quote/quote-create-debit-amount.php new file mode 100644 index 00000000..86e7a2bc --- /dev/null +++ b/snippets/php/quote/quote-create-debit-amount.php @@ -0,0 +1,31 @@ +walletAddress()->get([ + 'url' => $config->getWalletAddressUrl() +]); +//@! end chunk 1 + +//@! start chunk 2 | title=Create quote +$newQuote = $opClient->quote()->create( + [ + 'url' => $wallet->resourceServer, + 'access_token' => $QUOTE_GRANT_ACCESS_TOKEN, + ], + [ + 'method' => "ilp", + 'walletAddress' => $wallet->id, + 'receiver' => $INCOMING_PAYMENT_URL, + 'debitAmount' => [ + 'assetCode' => $wallet->assetCode, + 'assetScale' => $wallet->assetScale, + 'value' => "130", + ], + ] +); +//@! end chunk 2 + +//@! start chunk 3 | title=Output +echo 'QUOTE_URL ' . $newQuote->id . PHP_EOL; +echo 'QUOTE ' . print_r($newQuote, true) . PHP_EOL; +//@! end chunk 3 diff --git a/snippets/php/quote/quote-create-receive-amount.php b/snippets/php/quote/quote-create-receive-amount.php new file mode 100644 index 00000000..b933f155 --- /dev/null +++ b/snippets/php/quote/quote-create-receive-amount.php @@ -0,0 +1,30 @@ +walletAddress()->get([ + 'url' => $config->getWalletAddressUrl() +]); +//@! end chunk 1 +//@! start chunk 2 | title=Create quote +$newQuote = $opClient->quote()->create( + [ + 'url' => $wallet->resourceServer, + 'access_token' => $QUOTE_GRANT_ACCESS_TOKEN, + ], + [ + 'method' => "ilp", + 'walletAddress' => $wallet->id, + 'receiver' => $INCOMING_PAYMENT_URL, + 'receiveAmount' => [ + 'assetCode' => $wallet->assetCode, + 'assetScale' => $wallet->assetScale, + 'value' => "130", + ], + ] +); +//@! end chunk 2 + +//@! start chunk 3 | title=Output +echo 'QUOTE_URL ' . $newQuote->id . PHP_EOL; +echo 'QUOTE ' . print_r($newQuote, true) . PHP_EOL; +//@! end chunk 3 diff --git a/snippets/php/quote/quote-create.php b/snippets/php/quote/quote-create.php new file mode 100644 index 00000000..18687afd --- /dev/null +++ b/snippets/php/quote/quote-create.php @@ -0,0 +1,24 @@ +walletAddress()->get([ + 'url' => $config->getWalletAddressUrl() +]); + +//@! start chunk 1 | title=Create quote +$newQuote = $opClient->quote()->create( + [ + 'url' => $wallet->resourceServer, + 'access_token' => $QUOTE_GRANT_ACCESS_TOKEN, + ], + [ + 'method' => "ilp", + 'walletAddress' => $wallet->id, + 'receiver' => $INCOMING_PAYMENT_URL, + ] +); +//@! end chunk 1 + +//@! start chunk 2 | title=Output +echo 'QUOTE_URL ' . $newQuote->id . PHP_EOL; +echo 'QUOTE ' . print_r($newQuote, true) . PHP_EOL; +//@! end chunk 2 diff --git a/snippets/php/quote/quote-get.php b/snippets/php/quote/quote-get.php new file mode 100644 index 00000000..e7df97d4 --- /dev/null +++ b/snippets/php/quote/quote-get.php @@ -0,0 +1,19 @@ +walletAddress()->get([ + 'url' => $config->getWalletAddressUrl() +]); + +//@! start chunk 1 | title=Create quote +$quote = $opClient->quote()->get( + [ + 'access_token' => $QUOTE_GRANT_ACCESS_TOKEN, + 'url' => $QUOTE_URL + ] +); +//@! end chunk 1 + +//@! start chunk 2 | title=Output +echo 'QUOTE_URL ' . $quote->id . PHP_EOL; +echo 'QUOTE ' . print_r($quote, true) . PHP_EOL; +//@! end chunk 2 diff --git a/snippets/php/token/token-revoke.php b/snippets/php/token/token-revoke.php new file mode 100644 index 00000000..d3e226d4 --- /dev/null +++ b/snippets/php/token/token-revoke.php @@ -0,0 +1,10 @@ +token()->revoke( + [ + 'access_token' => $ACCESS_TOKEN, + 'url' => $TOKEN_MANAGE_URL + ] +); +//@! end chunk 1 diff --git a/snippets/php/token/token-rotate.php b/snippets/php/token/token-rotate.php new file mode 100644 index 00000000..526ec080 --- /dev/null +++ b/snippets/php/token/token-rotate.php @@ -0,0 +1,15 @@ +token()->rotate( + [ + 'access_token' => $ACCESS_TOKEN, + 'url' => $TOKEN_MANAGE_URL + ] +); +//@! end chunk 1 + +//@! start chunk 2 | title=Output +echo 'ACCESS_TOKEN: ' . $token->value . PHP_EOL; +echo 'MANAGE_URL: ' . $token->manage . PHP_EOL; +//@! end chunk 2 diff --git a/snippets/php/wallet-address/wallet-address-get-keys.php b/snippets/php/wallet-address/wallet-address-get-keys.php new file mode 100644 index 00000000..49648fdc --- /dev/null +++ b/snippets/php/wallet-address/wallet-address-get-keys.php @@ -0,0 +1,21 @@ +walletAddress()->getKeys([ + 'url' => $config->getWalletAddressUrl() +]); +//@! end chunk 3 + +//@! start chunk 4 | title=Output wallet address keys +echo 'WALLET ADDRESS KEYS: ' . PHP_EOL . print_r($walletKeys, true); +//@! end chunk 4 diff --git a/snippets/php/wallet-address/wallet-address-get.php b/snippets/php/wallet-address/wallet-address-get.php new file mode 100644 index 00000000..adcd5209 --- /dev/null +++ b/snippets/php/wallet-address/wallet-address-get.php @@ -0,0 +1,21 @@ +walletAddress()->get([ + 'url' => $config->getWalletAddressUrl() +]); +//@! end chunk 3 + +//@! start chunk 4 | title=Output wallet address information +echo 'WALLET ADDRESS: ' . PHP_EOL . print_r($wallet, true); +//@! end chunk 4 From 40e3be778f2b8b711a1e421ab1a1f14b036c0e74 Mon Sep 17 00:00:00 2001 From: Adrian Boros Date: Tue, 25 Nov 2025 14:08:45 +0200 Subject: [PATCH 2/5] feat(docs): small lint fix --- docs/src/partials/php-import-initialize.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/partials/php-import-initialize.mdx b/docs/src/partials/php-import-initialize.mdx index c5aaebe1..919596e6 100644 --- a/docs/src/partials/php-import-initialize.mdx +++ b/docs/src/partials/php-import-initialize.mdx @@ -10,4 +10,4 @@ import ChunkedSnippet from '/src/components/ChunkedSnippet.astro' source='grant/grant-incoming-payment.php' l='php' chunk='2' -/> \ No newline at end of file +/> From 926d1cbd00f482773e31435e2eb87c29197c8f7d Mon Sep 17 00:00:00 2001 From: Adrian Boros Date: Tue, 25 Nov 2025 14:33:18 +0200 Subject: [PATCH 3/5] feat(docs): small updates --- docs/src/content/docs/sdk/wallet-get-info.mdx | 2 -- docs/src/partials/php-import-initialize.mdx | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/src/content/docs/sdk/wallet-get-info.mdx b/docs/src/content/docs/sdk/wallet-get-info.mdx index 33c12fc2..f3041d9a 100644 --- a/docs/src/content/docs/sdk/wallet-get-info.mdx +++ b/docs/src/content/docs/sdk/wallet-get-info.mdx @@ -77,8 +77,6 @@ For JavaScript, run `node path/to/directory/index.js`. Prerequisites - - From b4766bfce70be717cc128c21da4899ce26704653 Mon Sep 17 00:00:00 2001 From: Adrian Boros Date: Wed, 26 Nov 2025 15:07:40 +0200 Subject: [PATCH 4/5] feat(docs): guides php snippets --- .../guides/accept-otp-online-purchase.mdx | 143 ++++++++++++ .../guides/onetime-remittance-fixed-debit.mdx | 136 ++++++++++++ .../onetime-remittance-fixed-receive.mdx | 143 ++++++++++++ .../guides/outgoing-grant-future-payments.mdx | 57 +++++ .../recurring-remittance-fixed-debit.mdx | 110 ++++++++++ .../recurring-remittance-fixed-receive.mdx | 144 ++++++++++++ ...recurring-subscription-incoming-amount.mdx | 144 ++++++++++++ .../content/docs/guides/split-payments.mdx | 206 ++++++++++++++++++ 8 files changed, 1083 insertions(+) diff --git a/docs/src/content/docs/guides/accept-otp-online-purchase.mdx b/docs/src/content/docs/guides/accept-otp-online-purchase.mdx index 6d0f5d2f..7710b812 100644 --- a/docs/src/content/docs/guides/accept-otp-online-purchase.mdx +++ b/docs/src/content/docs/guides/accept-otp-online-purchase.mdx @@ -62,6 +62,16 @@ Call the [Get Wallet Address API](/apis/wall let retailer_wallet_address = client.wallet_address().get("https://happylifebank.example.com/retailer").await?; ``` + + ```php wrap + $customerWalletAddress = $client->walletAddress()->get([ + 'url' => 'https://cloudninebank.example.com/customer' + ]); + $retailerWalletAddress = $client->walletAddress()->get([ + 'url' => 'https://happylifebank.example.com/retailer' + ]); + ``` +
@@ -120,6 +130,25 @@ let retailer_incoming_payment_grant = client ```` + +```php wrap + +$retailerIncomingPaymentGrant = $client->grant()->request( + [ + 'url' => $retailerWalletAddress->authServer + ], + [ + 'access_token' => [ + 'access' => [ + [ + 'type' => 'incoming-payment', + 'actions' => ['read', 'complete', 'create', 'list'] + ] + ] + ] + ] +``` +
@@ -197,6 +226,24 @@ Some(&retailer_incoming_payment_grant.access_token.value), ```` + +```php wrap +$retailerIncomingPayment = $client->incomingPayment()->create( + [ + 'url' => $retailerWalletAddress->resourceServer, + 'accessToken' => $retailerIncomingPaymentGrant->access_token->value + ], + [ + 'walletAddress' => $retailerWalletAddress->id, + 'incomingAmount' => [ + 'value' => '140000', + 'assetCode' => 'MXN', + 'assetScale' => 2 + ] + ] +); +``` +
@@ -271,6 +318,25 @@ let customer_quote_grant = client ```` + +```php wrap +$customerQuoteGrant = $client->grant()->request( + [ + 'url' => $customerWalletAddress->authServer + ], + [ + 'access_token' => [ + 'access' => [ + [ + 'type' => 'quote', + 'actions' => ['create'] + ] + ] + ] + ] +); +``` +
@@ -346,6 +412,21 @@ Some(&customer_quote_grant.access_token.value), ```` + +```php wrap +$customerQuote = $client->quote()->create( + [ + 'url' => $customerWalletAddress->resourceServer, + 'accessToken' => $customerQuoteGrant->access_token->value + ], + [ + 'method' => 'ilp', + 'walletAddress' => $customerWalletAddress->id, + 'receiver' => $retailerIncomingPayment->id + ] +); +``` + The response returns a `receiveAmount`, a `debitAmount`, and other required information. @@ -455,6 +536,41 @@ Outgoing payments require an interactive grant. This type of grant will obtain t .await?; ``` + + ```php wrap + $pendingCustomerOutgoingPaymentGrant = $client->grant()->request( + [ + 'url' => $customerWalletAddress->authServer + ], + [ + 'access_token' => [ + 'access' => [ + [ + 'identifier' => $customerWalletAddress->id, + 'type' => 'outgoing-payment', + 'actions' => ['create'], + 'limits' => [ + 'debitAmount' => [ + 'assetCode' => 'MXN', + 'assetScale' => 2, + 'value' => '140000' + ] + ] + ] + ] + ], + 'interact' => [ + 'start' => ['redirect'], + 'finish' => [ + 'method' => 'redirect', + 'uri' => 'https://paymentplatform.example/finish/{...}', // where to redirect the customer after they've completed the interaction + 'nonce' => 'NONCE' + ] + ] + ] + ); + ``` +
@@ -534,6 +650,19 @@ Some(&continue_field.access_token.value), ```` + +```php wrap +$customerOutgoingPaymentGrant = $client->grant()->continue( + [ + 'url' => $pendingCustomerOutgoingPaymentGrant->continue->uri, + 'accessToken' => $pendingCustomerOutgoingPaymentGrant->continue->access_token->value + ], + [ + 'interact_ref' => $interactRef + ] +); +``` +
@@ -605,6 +734,20 @@ Use the access token returned in Step 9 to call the + ```php wrap + $customerOutgoingPayment = $client->outgoingPayment()->create( + [ + 'url' => $customerWalletAddress->resourceServer, + 'accessToken' => $customerOutgoingPaymentGrant->access_token->value + ], + [ + 'walletAddress' => $customerWalletAddress->id, + 'quoteId' => $customerQuote->id + ] + ); + ``` + If the request fails because of an expired quote, [request a new quote](#5-request-the-creation-of-a-quote-resource) and try again. diff --git a/docs/src/content/docs/guides/onetime-remittance-fixed-debit.mdx b/docs/src/content/docs/guides/onetime-remittance-fixed-debit.mdx index a1fa100d..36df2f6a 100644 --- a/docs/src/content/docs/guides/onetime-remittance-fixed-debit.mdx +++ b/docs/src/content/docs/guides/onetime-remittance-fixed-debit.mdx @@ -74,6 +74,16 @@ Call the [Get Wallet Address API](/apis/wall let recipient_wallet_address = client.wallet_address().get("https://happylifebank.example.com/recipient").await?; ``` + + ```php wrap + $senderWalletAddress = $client->walletAddress()->get([ + 'url' => 'https://cloudninebank.example.com/sender' + ]); + $recipientWalletAddress = $client->walletAddress()->get([ + 'url' => 'https://happylifebank.example.com/recipient' + ]); + ``` +
@@ -141,6 +151,22 @@ This call obtains an access token that allows your app to request that an incomi .await?; ``` + + ```php wrap + $recipientIncomingPaymentGrant = $client->grant()->request([ + 'url' => $recipientWalletAddress->authServer + ], [ + 'access_token' => [ + 'access' => [ + [ + 'type' => 'incoming-payment', + 'actions' => ['create'] + ] + ] + ] + ]); + ``` +
@@ -209,6 +235,16 @@ This call requests an incoming payment resource be created on the recipient's wa .await?; ``` + + ```php wrap + $recipientIncomingPayment = $client->incomingPayment()->create([ + 'url' => $recipientWalletAddress->resourceServer, + 'accessToken' => $recipientIncomingPaymentGrant->access_token->value + ], [ + 'walletAddress' => $recipientWalletAddress->id + ]); + ``` +
@@ -277,6 +313,24 @@ This call obtains an access token that allows your app to request that a quote r .await?; ``` + + ```php wrap + $senderQuoteGrant = $client->grant()->request( + [ + 'url' => $senderWalletAddress->authServer + ], + [ + 'access_token' => [ + 'access' => [ + [ + 'type' => 'quote', + 'actions' => ['create'] + ] + ] + ] + ]); + ``` +
@@ -358,6 +412,26 @@ The `debitAmount` specifies that the sender will pay exactly $100 USD, and the r .await?; ``` + + ```php wrap + $senderQuote = $client->quote()->create( + [ + 'url' => $senderWalletAddress->resourceServer, + 'accessToken' => $senderQuoteGrant->access_token->value + ], + [ + 'method' => 'ilp', + 'walletAddress' => $senderWalletAddress->id, + 'receiver' => $recipientIncomingPayment->id, + 'debitAmount' => [ + 'value' => '10000', // Sender pays exactly $100.00 USD + 'assetCode' => 'USD', + 'assetScale' => 2 + ] + ] + ); + ``` + The response returns a `receiveAmount`, a `debitAmount`, and other required information. @@ -490,6 +564,41 @@ let pending_sender_outgoing_payment_grant = client ```` + + ```php wrap + $pendingSenderOutgoingPaymentGrant = $client->grant()->request( + [ + 'url' => $senderWalletAddress->authServer + ], + [ + 'access_token' => [ + 'access' => [ + [ + 'identifier' => $senderWalletAddress->id, + 'type' => 'outgoing-payment', + 'actions' => ['create'], + 'limits' => [ + 'debitAmount' => [ + 'assetCode' => 'USD', + 'assetScale' => 2, + 'value' => '10000' // Sender pays exactly $100.00 USD + ] + ] + ] + ] + ], + 'interact' => [ + 'start' => ['redirect'], + 'finish' => [ + 'method' => 'redirect', + 'uri' => 'https://myapp.example.com/finish/{...}', // where to redirect your user after they've completed the interaction + 'nonce' => 'NONCE' + ] + ] + ] + ); + ``` +
@@ -568,6 +677,19 @@ Include the `interact_ref` returned in the redirect URI's query parameters. .await?; ``` + + ```php wrap + $senderOutgoingPaymentGrant = $client->grant()->continue( + [ + 'url' => $pendingSenderOutgoingPaymentGrant->continue->uri, + 'accessToken' => $pendingSenderOutgoingPaymentGrant->continue->access_token->value + ], + [ + 'interact_ref' => $interactRef + ] + ); + ``` +
@@ -639,6 +761,20 @@ Use the access token returned in Step 9 to call the + ```php wrap + $senderOutgoingPayment = $client->outgoingPayment()->create( + [ + 'url' => $senderWalletAddress->resourceServer, + 'accessToken' => $senderOutgoingPaymentGrant->access_token->value + ], + [ + 'walletAddress' => $senderWalletAddress->id, + 'quoteId' => $senderQuote->id + ] + ); + ``` + If the request fails because of an expired quote, [request a new quote](#5-request-the-creation-of-a-quote-resource) and try again. diff --git a/docs/src/content/docs/guides/onetime-remittance-fixed-receive.mdx b/docs/src/content/docs/guides/onetime-remittance-fixed-receive.mdx index a1c643d4..58e008ee 100644 --- a/docs/src/content/docs/guides/onetime-remittance-fixed-receive.mdx +++ b/docs/src/content/docs/guides/onetime-remittance-fixed-receive.mdx @@ -73,6 +73,16 @@ Call the [Get Wallet Address API](/apis/wall let recipient_wallet_address = client.wallet_address().get("https://happylifebank.example.com/recipient").await?; ``` + + ```php wrap + $senderWalletAddress = $client->walletAddress()->get([ + 'url' => 'https://cloudninebank.example.com/sender' + ]); + $recipientWalletAddress = $client->walletAddress()->get([ + 'url' => 'https://happylifebank.example.com/recipient' + ]); + ``` +
@@ -144,6 +154,25 @@ let recipient_incoming_payment_grant = client ```` + + ```php wrap + $recipientIncomingPaymentGrant = $client->grant()->request( + [ + 'url' => $recipientWalletAddress->authServer + ], + [ + 'access_token' => [ + 'access' => [ + [ + 'type' => 'incoming-payment', + 'actions' => ['create'] + ], + ], + ], + ] + ); + ``` +
@@ -213,6 +242,19 @@ Some(&recipient_incoming_payment_grant.access_token.value), ```` + + ```php wrap + $recipientIncomingPayment = $client->incomingPayment()->create( + [ + 'url' => $recipientWalletAddress->resourceServer, + 'accessToken' => $recipientIncomingPaymentGrant->access_token->value + ], + [ + 'walletAddress' => $recipientWalletAddress->id, + ] + ); + ``` +
@@ -287,6 +329,25 @@ let sender_quote_grant = client ```` + + ```php wrap + $senderQuoteGrant = $client->grant()->request( + [ + 'url' => $senderWalletAddress->authServer + ], + [ + 'access_token' => [ + 'access' => [ + [ + 'type' => 'quote', + 'actions' => ['create'] + ] + ] + ] + ] + ); + ``` +
@@ -368,6 +429,26 @@ Some(&sender_quote_grant.access_token.value), ```` + + ```php wrap + $senderQuote = $client->quote()->create( + [ + 'url' => $senderWalletAddress->resourceServer, + 'accessToken' => $senderQuoteGrant->access_token->value + ], + [ + 'method' => 'ilp', + 'walletAddress' => $senderWalletAddress->id, + 'receiver' => $recipientIncomingPayment->id, + 'receiveAmount' => [ + 'value' => '500000', + 'assetCode' => 'MXN', + 'assetScale' => 2 + ] + ] + ); + ``` + The response returns a `receiveAmount`, a `debitAmount`, and other required information. @@ -496,6 +577,41 @@ let pending_sender_outgoing_payment_grant = client ```` + + ```php wrap + $pendingSenderOutgoingPaymentGrant = $client->grant()->request( + [ + 'url' => $senderWalletAddress->authServer + ], + [ + 'access_token' => [ + 'access' => [ + [ + 'identifier' => $senderWalletAddress->id, + 'type' => 'outgoing-payment', + 'actions' => ['create'], + 'limits' => [ + 'receiveAmount' => [ + 'assetCode' => 'MXN', + 'assetScale' => 2, + 'value' => '500000' + ] + ] + ] + ] + ], + 'interact' => [ + 'start' => ['redirect'], + 'finish' => [ + 'method' => 'redirect', + 'uri' => 'https://myapp.example.com/finish/{...}', // where to redirect your user after they've completed the interaction + 'nonce' => 'NONCE' + ] + ] + ] + ); + ``` +
@@ -574,6 +690,19 @@ Include the `interact_ref` returned in the redirect URI's query parameters. .await?; ``` + + ```php wrap + $senderOutgoingPaymentGrant = $client->grant()->continue( + [ + 'url' => $pendingSenderOutgoingPaymentGrant->continue->uri, + 'accessToken' => $pendingSenderOutgoingPaymentGrant->continue->access_token->value + ], + [ + 'interact_ref' => $interactRef + ] + ); + ``` +
@@ -644,6 +773,20 @@ Use the access token returned in Step 9 to call the + ```php wrap + $senderOutgoingPayment = $client->outgoingPayment()->create( + [ + 'url' => $senderWalletAddress->resourceServer, + 'accessToken' => $senderOutgoingPaymentGrant->access_token->value + ], + [ + 'walletAddress' => $senderWalletAddress->id, + 'quoteId' => $senderQuote->id + ] + ); + ``` + If the request fails because of an expired quote, [request a new quote](#5-request-the-creation-of-a-quote-resource) and try again. diff --git a/docs/src/content/docs/guides/outgoing-grant-future-payments.mdx b/docs/src/content/docs/guides/outgoing-grant-future-payments.mdx index 412b737f..b66c4a92 100644 --- a/docs/src/content/docs/guides/outgoing-grant-future-payments.mdx +++ b/docs/src/content/docs/guides/outgoing-grant-future-payments.mdx @@ -49,6 +49,13 @@ Let's assume your user saved their wallet address in their account profile when let user_wallet_address = client.wallet_address().get("https://cloudninebank.example.com/user").await?; ``` + + ```php wrap + $userWalletAddress = $client->walletAddress()->get([ + 'url' => 'https://cloudninebank.example.com/user' + ]); + ``` +
@@ -134,6 +141,43 @@ Remember, your user wants to send payments of up to $100 CAD a month for three m .await?; ``` + + ```php wrap + $grant = $client->grant()->request( + [ + 'url' => $userWalletAddress->authServer, + ], + [ + 'access_token' => [ + 'access' => [ + [ + 'identifier' => $userWalletAddress->id, + 'type' => 'outgoing-payment', + 'actions' => ['read', 'create'], + 'limits' => [ + 'interval' => 'R3/2025-05-20T13:00:00Z/P1M', + 'debitAmount' => [ + 'assetCode' => 'CAD', + 'assetScale' => 2, + 'value' => '10000', + ], + ], + ], + ], + ], + 'client' => $userWalletAddress->id, + 'interact' => [ + 'start' => ['redirect'], + 'finish' => [ + 'method' => 'redirect', + 'uri' => 'https://paymentplatform.example/finish/{...}', // where to redirect the user to after they've completed the interaction + 'nonce' => NONCE, + ], + ], + ], + ); + ``` +
@@ -225,6 +269,19 @@ Include the `interact_ref` returned in the redirect URI's query parameters. .await?; ``` + + ```php wrap + $userOutgoingPaymentGrant = $client->grant()->continue( + [ + 'accessToken' => $pendingUserOutgoingPaymentGrant->continue->access_token->value, + 'url' => $pendingUserOutgoingPaymentGrant->continue->uri, + ], + [ + 'interact_ref' => $interactRef, + ], + ); + ``` + A successful response provides your app with an access token. Now your app can issue outgoing payment requests to future recipients against the grant. Each request must reference the access token. diff --git a/docs/src/content/docs/guides/recurring-remittance-fixed-debit.mdx b/docs/src/content/docs/guides/recurring-remittance-fixed-debit.mdx index 5004797e..61a1ed0c 100644 --- a/docs/src/content/docs/guides/recurring-remittance-fixed-debit.mdx +++ b/docs/src/content/docs/guides/recurring-remittance-fixed-debit.mdx @@ -68,6 +68,16 @@ Call the [Get Wallet Address API](/apis/wall }) ``` + + ```php wrap + $senderWalletAddress = $client->walletAddress()->get([ + 'url' => 'https://cloudninebank.example.com/sender' + ]); + $recipientWalletAddress = $client->walletAddress()->get([ + 'url' => 'https://happylifebank.example.com/recipient' + ]); + ``` +
@@ -122,6 +132,25 @@ This call obtains an access token that allows your app to request an incoming pa ); ``` + + ```php wrap + $recipientIncomingPaymentGrant = $client->grant()->request( + [ + 'url' => $recipientWalletAddress->authServer + ], + [ + 'access_token' => [ + 'access' => [ + [ + 'type' => 'incoming-payment', + 'actions' => ['create'], + ], + ], + ], + ] + ); + ``` +
@@ -169,6 +198,19 @@ This call requests an incoming payment resource be created on the recipient's wa ) ``` + + ```php wrap + $recipientIncomingPayment = $client->incomingPayment()->create( + [ + 'url' => $recipientWalletAddress->resourceServer, + 'accessToken' => $recipientIncomingPaymentGrant->access_token->value + ], + [ + 'walletAddress' => $recipientWalletAddress->id + ] + ); + ``` +
@@ -248,6 +290,42 @@ Outgoing payments require an interactive grant, which the sender approves once. ) ``` + + ```php wrap + $pendingSenderOutgoingPaymentGrant = $client->grant()->request( + [ + 'url' => $senderWalletAddress->authServer + ], + [ + 'access_token' => [ + 'access' => [ + [ + 'identifier' => $senderWalletAddress->id, + 'type' => 'outgoing-payment', + 'actions' => ['create'], + 'limits' => [ + 'interval' => 'R3/2025-10-03T23:25:00Z/P1M', + 'debitAmount' => [ + 'assetCode' => 'USD', + 'assetScale' => 2, + 'value' => '20000', // $200.00 USD per interval + ] + ] + ] + ] + ], + 'interact' => [ + 'start' => ['redirect'], + 'finish' => [ + 'method' => 'redirect', + 'uri' => 'https://myapp.example.com/finish/{...}', // where to redirect your user after they've completed the interaction + 'nonce' => NONCE + ] + ] + ] + ); + ``` +
@@ -321,6 +399,19 @@ Include the `interact_ref` returned in the redirect URI's query parameters. ) ``` + + ```php wrap + $senderOutgoingPaymentGrant = $client->grant()->continue( + [ + 'url' => $pendingSenderOutgoingPaymentGrant->continue->uri, + 'accessToken' => $pendingSenderOutgoingPaymentGrant->continue->access_token->value + ], + [ + 'interact_ref' => $interactRef + ] + ); + ``` +
@@ -381,6 +472,25 @@ Use the access token returned in the outgoing payment grant continuation respons ) ``` + + ```php wrap + $senderOutgoingPayment = $client->outgoingPayment()->create( + [ + 'url' => $senderWalletAddress->resourceServer, + 'accessToken' => $senderOutgoingPaymentGrant->access_token->value + ], + [ + 'walletAddress' => $senderWalletAddress->id, + 'incomingPayment' => $recipientIncomingPayment->id, + 'debitAmount' => [ + 'assetCode' => 'USD', + 'assetScale' => 2, + 'value' => '20000' + ], + ] + ); + ``` +
diff --git a/docs/src/content/docs/guides/recurring-remittance-fixed-receive.mdx b/docs/src/content/docs/guides/recurring-remittance-fixed-receive.mdx index 27b80095..6e95bcf6 100644 --- a/docs/src/content/docs/guides/recurring-remittance-fixed-receive.mdx +++ b/docs/src/content/docs/guides/recurring-remittance-fixed-receive.mdx @@ -69,6 +69,16 @@ Call the [Get Wallet Address API](/apis/wall }) ``` + + ```php wrap + $senderWalletAddress = $client->walletAddress()->get([ + 'url' => 'https://cloudninebank.example.com/sender' + ]); + $recipientWalletAddress = $client->walletAddress()->get([ + 'url' => 'https://happylifebank.example.com/recipient' + ]); + ``` +
@@ -149,6 +159,42 @@ Outgoing payments require an interactive grant, which the sender approves once. ) ``` + + ```php wrap + $pendingSenderOutgoingPaymentGrant = $client->grant()->request( + [ + 'url' => $senderWalletAddress->authServer + ], + [ + 'access_token' => [ + 'access' => [ + [ + 'identifier' => $senderWalletAddress->id, + 'type' => 'outgoing-payment', + 'actions' => ['create'], + 'limits' => [ + 'interval' => 'R3/2025-10-03T23:25:00Z/P1M', + 'receiveAmount' => [ + 'assetCode' => 'MXN', + 'assetScale' => 2, + 'value' => '400000', + ] + ] + ] + ] + ], + 'interact' => [ + 'start' => ['redirect'], + 'finish' => [ + 'method' => 'redirect', + 'uri' => 'https://myapp.example.com/finish/{...}', // where to redirect your user after they've completed the interaction + 'nonce' => NONCE + ] + ] + ] + ); + ``` +
@@ -222,6 +268,19 @@ Include the `interact_ref` returned in the redirect URI's query parameters. ) ``` + + ```php wrap + $senderOutgoingPaymentGrant = $client->grant()->continue( + [ + 'url' => $pendingSenderOutgoingPaymentGrant->continue->uri, + 'accessToken' => $pendingSenderOutgoingPaymentGrant->continue->access_token->value + ], + [ + 'interact_ref' => $interactRef + ] + ); + ``` +
@@ -284,6 +343,25 @@ This call obtains an access token that allows your app to request an incoming pa ); ``` + + ```php wrap + $recipientIncomingPaymentGrant = $client->grant()->request( + [ + 'url' => $recipientWalletAddress->authServer + ], + [ + 'access_token' => [ + 'access' => [ + [ + 'type' => 'incoming-payment', + 'actions' => ['create'], + ], + ], + ], + ] + ); + ``` +
@@ -331,6 +409,19 @@ This call requests an incoming payment resource be created on the recipient's wa ) ``` + + ```php wrap + $recipientIncomingPayment = $client->incomingPayment()->create( + [ + 'url' => $recipientWalletAddress->resourceServer, + 'accessToken' => $recipientIncomingPaymentGrant->access_token->value + ], + [ + 'walletAddress' => $recipientWalletAddress->id, + ] + ); + ``` +
@@ -384,6 +475,25 @@ This call obtains an access token that allows your app to request a quote resour ) ``` + + ```php wrap + $senderQuoteGrant = $client->grant()->request( + [ + 'url' => $senderWalletAddress->authServer + ], + [ + 'access_token' => [ + 'access' => [ + [ + 'type' => 'quote', + 'actions' => ['create'] + ] + ] + ] + ] + ); + ``` +
@@ -440,6 +550,26 @@ The `receiveAmount` specifies that the recipient will receive exactly $4,000 MXN ) ``` + + ```php wrap + $senderQuote = $client->quote()->create( + [ + 'url' => $senderWalletAddress->resourceServer, + 'accessToken' => $senderQuoteGrant->access_token->value + ], + [ + 'method' => 'ilp', + 'walletAddress' => $senderWalletAddress->id, + 'receiver' => $recipientIncomingPayment->id, + 'receiveAmount' => [ + 'value' => '400000', + 'assetCode' => 'MXN', + 'assetScale' => 2 + ] + ] + ); + ``` + The response returns a `receiveAmount`, a `debitAmount`, and other required information. @@ -495,6 +625,20 @@ Use the access token returned in the outgoing payment grant continuation respons ) ``` + + ```php wrap + $senderOutgoingPayment = $client->outgoingPayment()->create( + [ + 'url' => $senderWalletAddress->resourceServer, + 'accessToken' => $senderOutgoingPaymentGrant->access_token->value + ], + [ + 'walletAddress' => $senderWalletAddress->id, + 'quoteId' => $senderQuote->id, + ] + ); + ``` +
diff --git a/docs/src/content/docs/guides/recurring-subscription-incoming-amount.mdx b/docs/src/content/docs/guides/recurring-subscription-incoming-amount.mdx index 319a9df8..d67a392f 100644 --- a/docs/src/content/docs/guides/recurring-subscription-incoming-amount.mdx +++ b/docs/src/content/docs/guides/recurring-subscription-incoming-amount.mdx @@ -67,6 +67,16 @@ Call the [Get Wallet Address API](/apis/wall }) ``` + + ```php wrap + $customerWalletAddress = $client->walletAddress()->get([ + 'url' => 'https://cloudninebank.example.com/customer' + ]); + $serviceProviderWalletAddress = $client->walletAddress()->get([ + 'url' => 'https://happylifebank.example.com/service-provider' + ]); + ``` +
@@ -119,6 +129,25 @@ This call obtains an access token that allows you to request that an incoming pa ); ``` + + ```php wrap + $serviceProviderIncomingPaymentGrant = $client->grant()->request( + [ + 'url' => $serviceProviderWalletAddress->authServer + ], + [ + 'access_token' => [ + 'access' => [ + [ + 'type' => 'incoming-payment', + 'actions' => ['create'] + ] + ] + ] + ] + ); + ``` +
@@ -172,6 +201,24 @@ This call requests an incoming payment resource be created on the service provid }, ) ``` + + + ```php wrap + $serviceProviderIncomingPayment = $client->incomingPayment()->create( + [ + 'url' => $serviceProviderWalletAddress->resourceServer, + 'accessToken' => $serviceProviderIncomingPaymentGrant->access_token->value + ], + [ + 'walletAddress' => $serviceProviderWalletAddress->id, + 'incomingAmount' => [ + 'value' => '1500', // The amount the service provider expects to receive in the first payment + 'assetCode' => 'USD', + 'assetScale' => 2 + ], + ] + ); + ``` @@ -233,6 +280,25 @@ This call obtains an access token that allows you to request that a quote resour ) ``` + + ```php wrap + $customerQuoteGrant = $client->grant()->request( + [ + 'url' => $customerWalletAddress->authServer + ], + [ + 'access_token' => [ + 'access' => [ + [ + 'type' => 'quote', + 'actions' => ['create'] + ] + ] + ] + ] + ); + ``` +
@@ -286,6 +352,21 @@ The request must contain the `receiver`, which is the `id` of the service provid ) ``` + + ```php wrap + $customerQuote = $client->quote()->create( + [ + 'url' => $customerWalletAddress->resourceServer, + 'accessToken' => $customerQuoteGrant->access_token->value + ], + [ + 'method' => 'ilp', + 'walletAddress' => $customerWalletAddress->id, + 'receiver' => $serviceProviderIncomingPayment->id, + ] + ); + ``` + The response returns a `debitAmount`, a `receiveAmount`, and other required information. @@ -373,6 +454,42 @@ For recurring payments, include the `interval` property to specify how often the ) ``` + + ```php wrap + $pendingCustomerOutgoingPaymentGrant = $client->grant()->request( + [ + 'url' => $customerWalletAddress->authServer + ], + [ + 'access_token' => [ + 'access' => [ + [ + 'identifier' => $customerWalletAddress->id, + 'type' => 'outgoing-payment', + 'actions' => ['create', 'read'], + 'limits' => [ + 'debitAmount' => [ + 'assetCode' => 'USD', + 'assetScale' => 2, + 'value' => '1500', + ], + 'interval' => 'R12/2025-10-14T00:03:00Z/P1M' + ] + ] + ] + ], + 'interact' => [ + 'start' => ['redirect'], + 'finish' => [ + 'method' => 'redirect', + 'uri' => 'https://myapp.example.com/finish/{...}', // where to redirect the customer after they've completed interaction + 'nonce' => NONCE + ] + ] + ] + ); + ``` +
@@ -444,6 +561,19 @@ Include the `interact_ref` returned in the redirect URI's query parameters. ) ``` + + ```php wrap + $customerOutgoingPaymentGrant = $client->grant()->continue( + [ + 'url' => $pendingCustomerOutgoingPaymentGrant->continue->uri, + 'accessToken' => $pendingCustomerOutgoingPaymentGrant->continue->access_token->value + ], + [ + 'interact_ref' => $interactRef + ] + ); + ``` +
@@ -503,6 +633,20 @@ Include the `quoteId` from the quote created in Step 5. ) ``` + + ```php wrap + $customerOutgoingPayment = $client->outgoingPayment()->create( + [ + 'url' => $customerWalletAddress->resourceServer, + 'accessToken' => $customerOutgoingPaymentGrant->access_token->value + ], + [ + 'walletAddress' => $customerWalletAddress->id, + 'quoteId' => $customerQuote->id + ] + ); + ``` +
diff --git a/docs/src/content/docs/guides/split-payments.mdx b/docs/src/content/docs/guides/split-payments.mdx index bbeda22a..2be2d529 100644 --- a/docs/src/content/docs/guides/split-payments.mdx +++ b/docs/src/content/docs/guides/split-payments.mdx @@ -67,6 +67,19 @@ Call the [Get Wallet Address API](/apis/wall let platform_wallet_address = client.wallet_address().get("https://coolwallet.example.com/platform").await?; ``` + + ```php wrap + $customerWalletAddress = $client->walletAddress()->get([ + 'url' => 'https://cloudninebank.example.com/customer' + ]); + $merchantWalletAddress = $client->walletAddress()->get([ + 'url' => 'https://happylifebank.example.com/merchant' + ]); + $platformWalletAddress = $client->walletAddress()->get([ + 'url' => 'https://coolwallet.example.com/platform' + ]); +``` +
@@ -148,6 +161,42 @@ If you and the merchant use the same account servicing entity, and as a result, .await?; ``` + + ```php wrap + // Merchant + $merchantIncomingPaymentGrant = $client->grant()->request( + [ + 'url' => $merchantWalletAddress->authServer + ], + [ + 'access_token' => [ + 'access' => [ + [ + 'type' => 'incoming-payment', + 'actions' => ['create'] + ] + ] + ] + ] + ); + // Platform + $platformIncomingPaymentGrant = $client->grant()->request( + [ + 'url' => $platformWalletAddress->authServer + ], + [ + 'access_token' => [ + 'access' => [ + [ + 'type' => 'incoming-payment', + 'actions' => ['create'] + ] + ] + ] + ] + ); + ``` +
@@ -246,6 +295,40 @@ Remember that the merchant is receiving 99% of the payment (\$99.00 or `9900`) w .await?; ``` + + ```php wrap + // Merchant + $merchantIncomingPayment = $client->incomingPayment()->create( + [ + 'url' => $merchantWalletAddress->resourceServer, + 'accessToken' => $merchantIncomingPaymentGrant->access_token->value + ], + [ + 'walletAddress' => $merchantWalletAddress->id, + 'incomingAmount' => [ + 'value' => '9900', + 'assetCode' => 'USD', + 'assetScale' => 2 + ] + ] + ); + // Platform + $platformIncomingPayment = $client->incomingPayment()->create( + [ + 'url' => $platformWalletAddress->resourceServer, + 'accessToken' => $platformIncomingPaymentGrant->access_token->value + ], + [ + 'walletAddress' => $platformWalletAddress->id, + 'incomingAmount' => [ + 'value' => '100', + 'assetCode' => 'USD', + 'assetScale' => 2 + ] + ] + ); + ``` +
@@ -321,6 +404,25 @@ This call obtains an access token that allows your platform to request quote res ``` + + ```php wrap + $customerQuoteGrant = $client->grant()->request( + [ + 'url' => $customerWalletAddress->authServer + ], + [ + 'access_token' => [ + 'access' => [ + [ + 'type' => 'quote', + 'actions' => ['create'] + ] + ] + ] + ] + ); + ``` +
@@ -415,6 +517,34 @@ Next, call the Create Quote API again an .await?; ``` + + ```php wrap + // Merchant + $merchantQuote = $client->quote()->create( + [ + 'url' => $customerWalletAddress->resourceServer, + 'accessToken' => $customerQuoteGrant->access_token->value + ], + [ + 'method' => 'ilp', + 'walletAddress' => $customerWalletAddress->id, + 'receiver' => $merchantIncomingPayment->id + ] + ); + // Platform + $platformQuote = $client->quote()->create( + [ + 'url' => $customerWalletAddress->resourceServer, + 'accessToken' => $customerQuoteGrant->access_token->value + ], + [ + 'method' => 'ilp', + 'walletAddress' => $customerWalletAddress->id, + 'receiver' => $platformIncomingPayment->id + ] + ); + ``` + Each response returns a `receiveAmount`, a `debitAmount`, and other required information. @@ -543,6 +673,43 @@ This call obtains an access token that allows your platform to request outgoing .await?; ``` + + ```php wrap + $combinedQuoteAmount = bcadd($merchantQuote->debitAmount->value, $platformQuote->debitAmount->value); + + $pendingCustomerOutgoingPaymentGrant = $client->grant()->request( + [ + 'url' => $customerWalletAddress->authServer + ], + [ + 'access_token' => [ + 'access' => [ + [ + 'identifier' => $customerWalletAddress->id, + 'type' => 'outgoing-payment', + 'actions' => ['create'], + 'limits' => [ + 'debitAmount' => [ + 'assetCode' => 'USD', + 'assetScale' => 2, + 'value' => $combinedQuoteAmount + ] + ] + ] + ] + ], + 'interact' => [ + 'start' => ['redirect'], + 'finish' => [ + 'method' => 'redirect', + 'uri' => 'https://paymentplatform.example/finish/{...}', // where to redirect the customer after they've completed interaction + 'nonce' => 'NONCE' + ] + ] + ] + ); + ``` +
@@ -614,6 +781,19 @@ Include the `interact_ref` returned in the redirect URI's query parameters. .await?; ``` + + ```php wrap + $customerOutgoingPaymentGrant = $client->grant()->continue( + [ + 'url' => $pendingCustomerOutgoingPaymentGrant->continue->uri, + 'accessToken' => $pendingCustomerOutgoingPaymentGrant->continue->access_token->value + ], + [ + 'interact_ref' => $interactRef + ] + ); + ``` +
@@ -708,6 +888,32 @@ Use the access token returned in Step 5 that's associated with the merchant to c .await?; ``` + + ```php wrap + // Merchant + $customerOutgoingPaymentToMerchant = $client->outgoingPayment()->create( + [ + 'url' => $customerWalletAddress->resourceServer, + 'accessToken' => $customerOutgoingPaymentGrant->access_token->value + ], + [ + 'walletAddress' => $customerWalletAddress->id, + 'quoteId' => $merchantQuote->id + ] + ); + // Platform + $customerOutgoingPaymentToPlatform = $client->outgoingPayment()->create( + [ + 'url' => $customerWalletAddress->resourceServer, + 'accessToken' => $customerOutgoingPaymentGrant->access_token->value + ], + [ + 'walletAddress' => $customerWalletAddress->id, + 'quoteId' => $platformQuote->id + ] + ); + ``` +
From 2dcef2c7f71a6538a37acbe1fcb55725fcc1a967 Mon Sep 17 00:00:00 2001 From: Adrian Boros Date: Tue, 2 Dec 2025 12:39:10 +0200 Subject: [PATCH 5/5] feat(docs): guides php snippets prettier fix --- docs/src/content/docs/sdk/grant-continue.mdx | 12 ++-------- .../docs/sdk/grant-create-incoming.mdx | 12 ++-------- .../docs/sdk/grant-create-outgoing.mdx | 24 ++++--------------- docs/src/content/docs/sdk/wallet-get-info.mdx | 24 +++++++++---------- docs/src/content/docs/sdk/wallet-get-keys.mdx | 24 +++++++++---------- 5 files changed, 32 insertions(+), 64 deletions(-) diff --git a/docs/src/content/docs/sdk/grant-continue.mdx b/docs/src/content/docs/sdk/grant-continue.mdx index 442bfbe6..60a6bd1c 100644 --- a/docs/src/content/docs/sdk/grant-continue.mdx +++ b/docs/src/content/docs/sdk/grant-continue.mdx @@ -68,17 +68,9 @@ For JavaScript, run `node path/to/directory/index.js`. - + - + - - + + {/* prettier-ignore */}

View full source without interval

diff --git a/docs/src/content/docs/sdk/wallet-get-info.mdx b/docs/src/content/docs/sdk/wallet-get-info.mdx index 590479ad..3ea32c3a 100644 --- a/docs/src/content/docs/sdk/wallet-get-info.mdx +++ b/docs/src/content/docs/sdk/wallet-get-info.mdx @@ -78,27 +78,27 @@ For JavaScript, run `node path/to/directory/index.js`. {/* prettier-ignore */} diff --git a/docs/src/content/docs/sdk/wallet-get-keys.mdx b/docs/src/content/docs/sdk/wallet-get-keys.mdx index 64333a41..cf6c5633 100644 --- a/docs/src/content/docs/sdk/wallet-get-keys.mdx +++ b/docs/src/content/docs/sdk/wallet-get-keys.mdx @@ -85,27 +85,27 @@ For JavaScript, run `node path/to/directory/index.js`. {/* prettier-ignore */}