From 23e89fff512056daa46b2ba0e3dc32c456523893 Mon Sep 17 00:00:00 2001 From: NastyaGos <72504315+NastyaGos@users.noreply.github.com> Date: Mon, 12 Jul 2021 06:37:21 -0700 Subject: [PATCH] Making code simpler for understanding --- api-examples/wallet/index.php | 70 ++++++++++++++++++----------------- 1 file changed, 36 insertions(+), 34 deletions(-) diff --git a/api-examples/wallet/index.php b/api-examples/wallet/index.php index ec6cf5f..da434e6 100644 --- a/api-examples/wallet/index.php +++ b/api-examples/wallet/index.php @@ -38,48 +38,50 @@

-
+ + + + + + + +
@@ -93,11 +95,12 @@ if (!empty($_GET['action'])) { + $apiUrl = 'https://api.coinpayments.net/api/v1/merchant/wallets'; + switch ($_GET['action']) { case 'Create a new merchant wallet': $method = 'POST'; - $apiUrl = 'https://api.coinpayments.net/api/v1/merchant/wallets'; $params = [ "currencyId" => $_GET['currencyId'], "label" => $_GET['label'], @@ -106,15 +109,14 @@ break; case 'Find by id': $method = 'GET'; - $apiUrl = 'https://api.coinpayments.net/api/v1/merchant/wallets' . '/' . $_GET['idForFinding']; + $apiUrl .= '/' . $_GET['idForFinding']; break; case 'List all': $method = 'GET'; - $apiUrl = 'https://api.coinpayments.net/api/v1/merchant/wallets'; break; case 'List transactions': $method = 'GET'; - $apiUrl = 'https://api.coinpayments.net/api/v1/merchant/wallets' . '/' . $_GET['idForFinding'] . '/transactions'; + $apiUrl .= '/' . $_GET['idForFinding'] . '/transactions'; break;