-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
234 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,8 +12,6 @@ | |
|
||
$curl = new Client(); | ||
|
||
|
||
|
||
$environment = new Environment( | ||
getenv('PG_PAYMENT_SHOP_ID'), //PG_PAYMENT_SHOP_ID SHOP_ID_MARKETPLACE | ||
getenv('PG_PAYMENT_SECRET_KEY'), //PG_PAYMENT_SECRET_KEY SECRET_KEY_MARKETPLACE | ||
|
@@ -30,67 +28,85 @@ | |
$bearer = $data->token; | ||
$client->setBearer($bearer); | ||
|
||
die(); | ||
|
||
//UPDATE SHOP | ||
|
||
$response = $client->updateShop( | ||
$environment->getShopId(), | ||
(new \Paygreen\Sdk\Payment\V3\Model\Shop())->setName('Nouveau Nom') | ||
); | ||
|
||
$jsonResponse = json_decode($response->getBody()->getContents()); | ||
$data = $jsonResponse->data; | ||
|
||
//LIST AND UPDATE PC | ||
//$response = $client->listPaymentConfig('shop_id'); | ||
//$pcs = json_decode($response->getBody()->getContents()); | ||
// | ||
//if(count($pcs->data) > 0) { | ||
// foreach ($pcs->data as $pc) { | ||
// $updatePc = new \Paygreen\Sdk\Payment\V3\Model\PaymentConfig(); | ||
//// $updatePc->setStatus('enabled'); | ||
// $updatePc->setConfig(['reuse_card_proposal' => true]); | ||
// | ||
// $resp = $client->updatePaymentConfig($pc->id, $updatePc); | ||
// dump($resp->getStatusCode(), $resp->getBody()->getContents()); | ||
// } | ||
//} | ||
// | ||
//die(); | ||
|
||
dump($data); die(); | ||
//UPDATE SHOP | ||
//$response = $client->updateShop( | ||
// $environment->getShopId(), | ||
// (new \Paygreen\Sdk\Payment\V3\Model\Shop())->setName('Nouveau Nom') | ||
//); | ||
// | ||
//$jsonResponse = json_decode($response->getBody()->getContents()); | ||
//$data = $jsonResponse->data; | ||
// | ||
//dump($data); die(); | ||
|
||
|
||
// List Payment Order | ||
$filters = [ | ||
'reference' => 'Lorem ipsum' | ||
]; | ||
$pagination = [ | ||
'max_per_page' => 19, | ||
'page' => 2 | ||
]; | ||
|
||
$response = $client->listPaymentOrder(null, null, $filters, $pagination); | ||
|
||
$jsonResponse = json_decode($response->getBody()->getContents()); | ||
$data = $jsonResponse->data; | ||
$pagination = $jsonResponse->pagination; | ||
|
||
|
||
dump($data,$pagination); die(); | ||
$filters = [ | ||
'email' => '[email protected]' | ||
]; | ||
|
||
// pagination settings | ||
$pagination = [ | ||
'max_per_page' => 10, | ||
'page' => 1 | ||
]; | ||
|
||
// call | ||
$response = $client->listBuyer($filters, $pagination); | ||
|
||
// response | ||
$jsonResponse = json_decode($response->getBody()->getContents()); | ||
$data = $jsonResponse->data; | ||
$pagination = $jsonResponse->pagination; | ||
|
||
dump("count buyer:" . count($data)); | ||
|
||
foreach ($data as $index => $buyer) { | ||
$responsePC = $client->getBuyer($buyer->id); | ||
dump($responsePC); | ||
$jsonResponsePC = json_decode($responsePC->getBody()->getContents()); | ||
$dataPC = $jsonResponsePC->data; | ||
dump($dataPC); | ||
die(); | ||
} | ||
die(); | ||
//$filters = [ | ||
// 'reference' => 'Lorem ipsum' | ||
//]; | ||
//$pagination = [ | ||
// 'max_per_page' => 19, | ||
// 'page' => 2 | ||
//]; | ||
// | ||
//$response = $client->listPaymentOrder(null, null, $filters, $pagination); | ||
// | ||
//$jsonResponse = json_decode($response->getBody()->getContents()); | ||
//$data = $jsonResponse->data; | ||
//$pagination = $jsonResponse->pagination; | ||
// | ||
// | ||
//dump($data,$pagination); die(); | ||
|
||
// List Buyer | ||
//$filters = [ | ||
// 'email' => '[email protected]' | ||
//]; | ||
// | ||
//// pagination settings | ||
//$pagination = [ | ||
// 'max_per_page' => 10, | ||
// 'page' => 1 | ||
//]; | ||
// | ||
//// call | ||
//$response = $client->listBuyer($filters, $pagination); | ||
// | ||
//// response | ||
//$jsonResponse = json_decode($response->getBody()->getContents()); | ||
//$data = $jsonResponse->data; | ||
//$pagination = $jsonResponse->pagination; | ||
// | ||
//dump("count buyer:" . count($data)); | ||
// | ||
//foreach ($data as $index => $buyer) { | ||
// $responsePC = $client->getBuyer($buyer->id); | ||
// dump($responsePC); | ||
// $jsonResponsePC = json_decode($responsePC->getBody()->getContents()); | ||
// $dataPC = $jsonResponsePC->data; | ||
// dump($dataPC); | ||
// die(); | ||
//} | ||
//die(); | ||
|
||
/*$response = $client->listTransaction(); | ||
dump($response); | ||
|
Oops, something went wrong.