Skip to content

Commit

Permalink
Merge branch 'release-1.3.13'
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaumbertin committed Jun 27, 2023
2 parents f25910f + a57a55b commit 805686c
Show file tree
Hide file tree
Showing 33 changed files with 75 additions and 75 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "paygreen/paygreen-php",
"version": "1.3.11",
"version": "1.3.13",
"description": "PayGreen PHP SDK",
"type": "library",
"license": "proprietary",
Expand Down
2 changes: 1 addition & 1 deletion lib/PaygreenSdk/Charity/V2/Request/AccountRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class AccountRequest extends \Paygreen\Sdk\Core\Request\Request
public function getGetRequest($clientId)
{
return $this->requestFactory->create(
"/account/{$clientId}",
'/account/' . urlencode($clientId),
null,
'GET'
)->withAuthorization()->getRequest();
Expand Down
4 changes: 2 additions & 2 deletions lib/PaygreenSdk/Charity/V2/Request/DonationRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function getCreateRequest($donation)
];

return $this->requestFactory->create(
"/donation",
'/donation',
(new Serializer([new CleanEmptyValueNormalizer()], [new JsonEncoder()]))->serialize($body, 'json')
)->withAuthorization()->withTestMode()->isJson()->getRequest();
}
Expand All @@ -54,7 +54,7 @@ public function getCreateRequest($donation)
public function getGetRequest($donationId)
{
return $this->requestFactory->create(
"/donation/{$donationId}",
'/donation/' . urlencode($donationId),
null,
'GET'
)->withAuthorization()->withTestMode()->getRequest();
Expand Down
6 changes: 3 additions & 3 deletions lib/PaygreenSdk/Charity/V2/Request/PartnershipRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class PartnershipRequest extends \Paygreen\Sdk\Core\Request\Request
public function getGroupsRequest()
{
return $this->requestFactory->create(
"/partnership-group",
'/partnership-group',
null,
'GET'
)->withAuthorization()->withTestMode()->getRequest();
Expand All @@ -26,7 +26,7 @@ public function getGroupsRequest()
public function getGroupRequest($externalId)
{
return $this->requestFactory->create(
"/partnership-group/{$externalId}",
'/partnership-group/' . urlencode($externalId),
null,
'GET'
)->withAuthorization()->withTestMode()->getRequest();
Expand All @@ -38,7 +38,7 @@ public function getGroupRequest($externalId)
public function getDefaultGroup()
{
return $this->requestFactory->create(
"/partnership-group?isDefault=1",
'/partnership-group?isDefault=1',
null,
'GET'
)->withAuthorization()->withTestMode()->getRequest();
Expand Down
2 changes: 1 addition & 1 deletion lib/PaygreenSdk/Charity/V2/Request/UserRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class UserRequest extends \Paygreen\Sdk\Core\Request\Request
public function getGetRequest($clientId, $username)
{
return $this->requestFactory->create(
"/account/{$clientId}/user/{$username}",
'/account/' . urlencode($clientId) . '/user/' . urlencode($username),
null,
'GET'
)->withAuthorization()->getRequest();
Expand Down
2 changes: 1 addition & 1 deletion lib/PaygreenSdk/Climate/V2/Request/AccountRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class AccountRequest extends \Paygreen\Sdk\Core\Request\Request
public function getGetRequest($clientId)
{
return $this->requestFactory->create(
"/account/{$clientId}",
'/account/' . urlencode($clientId),
null,
'GET'
)->withAuthorization()->getRequest();
Expand Down
4 changes: 2 additions & 2 deletions lib/PaygreenSdk/Climate/V2/Request/EmissionFactorRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function getListRequest(
$body = (new Serializer([new CleanEmptyValueNormalizer()], [new JsonEncoder()]))->serialize($body);

return $this->requestFactory->create(
"/carbon/emissionFactors?" . http_build_query($body),
'/carbon/emissionFactors?' . http_build_query($body),
null,
'GET'
)->withAuthorization()->getRequest();
Expand All @@ -50,7 +50,7 @@ public function getListRequest(
public function getGetRequest($emissionFactorId)
{
return $this->requestFactory->create(
"/carbon/emissionFactors/$emissionFactorId",
'/carbon/emissionFactors/' . urlencode($emissionFactorId),
null,
'GET'
)->withAuthorization()->getRequest();
Expand Down
14 changes: 7 additions & 7 deletions lib/PaygreenSdk/Climate/V2/Request/FootprintRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function getGetRequest($footprintId, $detailed = false)
$detailed = ($detailed) ? 1 : 0;

return $this->requestFactory->create(
"/carbon/footprints/{$footprintId}?detailed={$detailed}",
'/carbon/footprints/' . urlencode($footprintId) . '?detailed=' . urlencode($detailed),
null,
'GET'
)->withAuthorization()->withTestMode()->isJson()->getRequest();
Expand All @@ -61,7 +61,7 @@ public function getCloseRequest($footprintId, $status)
];

return $this->requestFactory->create(
"/carbon/footprints/{$footprintId}",
'/carbon/footprints/' . urlencode($footprintId),
(new Serializer([new CleanEmptyValueNormalizer()], [new JsonEncoder()]))->serialize($body, 'json'),
'PATCH'
)->withAuthorization()->withTestMode()->isJson()->getRequest();
Expand All @@ -81,7 +81,7 @@ public function getUserContributedRequest($footprintId, $amount)
];

return $this->requestFactory->create(
"/carbon/footprints/{$footprintId}",
'/carbon/footprints/' . urlencode($footprintId),
(new Serializer([new CleanEmptyValueNormalizer()], [new JsonEncoder()]))->serialize($body, 'json'),
'PATCH'
)->withAuthorization()->withTestMode()->isJson()->getRequest();
Expand All @@ -108,7 +108,7 @@ public function getAddWebBrowsingDataRequest($footprintId, WebBrowsingData $webB
];

return $this->requestFactory->create(
"/carbon/footprints/{$footprintId}/web",
'/carbon/footprints/' . urlencode($footprintId) . '/web',
(new Serializer([new CleanEmptyValueNormalizer()], [new JsonEncoder()]))->serialize($body, 'json')
)->withAuthorization()->withTestMode()->isJson()->getRequest();
}
Expand Down Expand Up @@ -142,7 +142,7 @@ public function getAddDeliveryDataRequest($footprintId, DeliveryData $deliveryDa
];

return $this->requestFactory->create(
"/carbon/footprints/{$footprintId}/delivery",
'/carbon/footprints/' . urlencode($footprintId) . '/delivery',
(new Serializer([new CleanEmptyValueNormalizer()], [new JsonEncoder()]))->serialize($body, 'json')
)->withAuthorization()->withTestMode()->isJson()->getRequest();
}
Expand All @@ -157,7 +157,7 @@ public function getAddDeliveryDataRequest($footprintId, DeliveryData $deliveryDa
public function getDeleteDeliveryDataRequest($footprintId)
{
return $this->requestFactory->create(
"/carbon/footprints/{$footprintId}/delivery",
'/carbon/footprints/' . urlencode($footprintId) . '/delivery',
null,
'DELETE'
)->withAuthorization()->withTestMode()->getRequest();
Expand All @@ -173,7 +173,7 @@ public function getDeleteDeliveryDataRequest($footprintId)
public function getReserveCarbonRequest($footprintId)
{
return $this->requestFactory->create(
"/carbon/footprints/{$footprintId}/contribution"
'/carbon/footprints/' . urlencode($footprintId) . '/contribution'
)->withAuthorization()->withTestMode()->getRequest();
}
}
10 changes: 5 additions & 5 deletions lib/PaygreenSdk/Climate/V2/Request/ProductRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function getAddProductDataRequest(
];

return $this->requestFactory->create(
"/carbon/footprints/{$footprintId}/products",
'/carbon/footprints/' . urlencode($footprintId) . '/products',
(new Serializer([new CleanEmptyValueNormalizer()], [new JsonEncoder()]))->serialize($body, 'json')
)->withAuthorization()->withTestMode()->isJson()->getRequest();
}
Expand Down Expand Up @@ -58,7 +58,7 @@ public function getAddProductsDataRequest($footprintId, $cartItems)
$body = ['products' => $products];

return $this->requestFactory->create(
"/carbon/footprints/{$footprintId}/product-cart",
'/carbon/footprints/' . urlencode($footprintId) . '/product-cart',
(new Serializer([new CleanEmptyValueNormalizer()], [new JsonEncoder()]))->serialize($body, 'json')
)->withAuthorization()->withTestMode()->isJson()->getRequest();
}
Expand All @@ -82,7 +82,7 @@ public function getCreateProductReferenceRequest(
];

return $this->requestFactory->create(
"/carbon/products/references",
'/carbon/products/references',
(new Serializer([new CleanEmptyValueNormalizer()], [new JsonEncoder()]))->serialize($body, 'json')
)->withAuthorization()->withTestMode()->isJson()->getRequest();
}
Expand All @@ -98,9 +98,9 @@ public function getCreateProductReferenceRequest(
public function getDeleteProductDataRequest($footprintId, $productExternalReference = null)
{
if (!empty($productExternalReference)) {
$url = "/carbon/footprints/{$footprintId}/products/{$productExternalReference}";
$url = '/carbon/footprints/' . urlencode($footprintId) . '/products/' . urlencode($productExternalReference);
} else {
$url = "/carbon/footprints/{$footprintId}/products";
$url = '/carbon/footprints/' . urlencode($footprintId) . '/products';
}

return $this->requestFactory->create(
Expand Down
2 changes: 1 addition & 1 deletion lib/PaygreenSdk/Climate/V2/Request/StatisticRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class StatisticRequest extends \Paygreen\Sdk\Core\Request\Request
public function getGetRequest()
{
return $this->requestFactory->create(
"/carbon/statistics/reports",
'/carbon/statistics/reports',
null,
'GET'
)->withAuthorization()->withTestMode()->isJson()->getRequest();
Expand Down
2 changes: 1 addition & 1 deletion lib/PaygreenSdk/Climate/V2/Request/TokenRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class TokenRequest extends \Paygreen\Sdk\Core\Request\Request
public function getGetRequest($footprintId)
{
return $this->requestFactory->create(
"/tokens/footprint/{$footprintId}",
'/tokens/footprint/' . urlencode($footprintId),
null,
'GET'
)->withAuthorization()->getRequest();
Expand Down
6 changes: 3 additions & 3 deletions lib/PaygreenSdk/Climate/V2/Request/UserRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class UserRequest extends \Paygreen\Sdk\Core\Request\Request
public function getGetRequest($clientId, $username)
{
return $this->requestFactory->create(
"/account/{$clientId}/user/{$username}",
'/account/' . urlencode($clientId) . '/user/' . urlencode($username),
null,
'GET'
)->withAuthorization()->getRequest();
Expand All @@ -27,7 +27,7 @@ public function getGetRequest($clientId, $username)
public function getGetCurrentUserRequest()
{
return $this->requestFactory->create(
"/account/me/user/me",
'/account/me/user/me',
null,
'GET'
)->withAuthorization()->getRequest();
Expand All @@ -41,7 +41,7 @@ public function getGetCurrentUserRequest()
public function getGetFavoriteProjectRequest($userId)
{
return $this->requestFactory->create(
"/carbon/public/projects?idUser={$userId}",
'/carbon/public/projects?idUser=' . urlencode($userId),
null,
'GET'
)->getRequest();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function getCancelRequest($transactionId)
];

return $this->requestFactory->create(
"/api/{$publicKey}/payins/transaction/cancel",
'/api/' . urlencode($publicKey) . '/payins/transaction/cancel',
(new Serializer([new CleanEmptyValueNormalizer()], [new JsonEncoder()]))->serialize($body, 'json')
)->withAuthorization()->isJson()->getRequest();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function getCreateRequest($paymentOrder)
}

return $this->requestFactory->create(
"/api/{$publicKey}/payins/transaction/cash",
'/api/' . urlencode($publicKey) . '/payins/transaction/cash',
(new Serializer([new CleanEmptyValueNormalizer()], [new JsonEncoder()]))->serialize($body, 'json')
)->withAuthorization()->isJson()->getRequest();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function getCreateRequest($paymentOrder)
$body['eligibleAmount'][$paymentOrder->getPaymentType()] = $body['amount'];

return $this->requestFactory->create(
"/api/{$publicKey}/payins/transaction/subscription",
'/api/' . urlencode($publicKey) . '/payins/transaction/subscription',
(new Serializer([new CleanEmptyValueNormalizer()], [new JsonEncoder()]))->serialize($body, 'json')
)->withAuthorization()->isJson()->getRequest();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function getCreateRequest($transactionId, $amount = null)
}

return $this->requestFactory->create(
"/api/{$publicKey}/payins/transaction/{$transactionId}",
'/api/' . urlencode($publicKey) . '/payins/transaction/' . urlencode($transactionId),
(new Serializer([new CleanEmptyValueNormalizer()], [new JsonEncoder()]))->serialize($body, 'json'),
'DELETE'
)->withAuthorization()->isJson()->getRequest();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function getCreateRequest($paymentOrder)
$body['eligibleAmount'][$paymentOrder->getPaymentType()] = $body['amount'];

return $this->requestFactory->create(
"/api/{$publicKey}/payins/transaction/tokenize",
'/api/' . urlencode($publicKey) . '/payins/transaction/tokenize',
(new Serializer([new CleanEmptyValueNormalizer()], [new JsonEncoder()]))->serialize($body, 'json')
)->withAuthorization()->isJson()->getRequest();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function getGetRequest($transactionId)
$publicKey = $this->environment->getPublicKey();

return $this->requestFactory->create(
"/api/{$publicKey}/payins/transaction/{$transactionId}",
'/api/' . urlencode($publicKey) . '/payins/transaction/' . urlencode($transactionId),
null,
'GET'
)->withAuthorization()->isJson()->getRequest();
Expand All @@ -35,7 +35,7 @@ public function getConfirmationRequest($transactionId)
$publicKey = $this->environment->getPublicKey();

return $this->requestFactory->create(
"/api/{$publicKey}/payins/transaction/{$transactionId}",
'/api/' . urlencode($publicKey) . '/payins/transaction/' . urlencode($transactionId),
null,
'PUT'
)->withAuthorization()->isJson()->getRequest();
Expand All @@ -56,7 +56,7 @@ public function getUpdateAmountRequest($transactionId, $amount)
];

return $this->requestFactory->create(
"/api/{$publicKey}/payins/transaction/{$transactionId}",
'/api/' . urlencode($publicKey) . '/payins/transaction/' . urlencode($transactionId),
(new Serializer([new CleanEmptyValueNormalizer()], [new JsonEncoder()]))->serialize($body, 'json'),
'PATCH'
)->withAuthorization()->isJson()->getRequest();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function getCreateRequest($paymentOrder)
$body['eligibleAmount'][$paymentOrder->getPaymentType()] = $body['amount'];

return $this->requestFactory->create(
"/api/{$publicKey}/payins/transaction/xtime",
'/api/' . urlencode($publicKey) . '/payins/transaction/xtime',
(new Serializer([new CleanEmptyValueNormalizer()], [new JsonEncoder()]))->serialize($body, 'json')
)->withAuthorization()->isJson()->getRequest();
}
Expand Down
2 changes: 1 addition & 1 deletion lib/PaygreenSdk/Payment/V2/Request/PaymentTypeRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public function getGetRequest()
$publicKey = $this->environment->getPublicKey();

return $this->requestFactory->create(
"/api/{$publicKey}/availablepaymenttype",
'/api/' . urlencode($publicKey) . '/availablepaymenttype',
null,
'GET'
)->withAuthorization()->isJson()->getRequest();
Expand Down
2 changes: 1 addition & 1 deletion lib/PaygreenSdk/Payment/V2/Request/ShopRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public function getGetRequest()
$publicKey = $this->environment->getPublicKey();

return $this->requestFactory->create(
"/api/{$publicKey}/shop",
'/api/' . urlencode($publicKey) . '/shop',
null,
'GET'
)->withAuthorization()->isJson()->getRequest();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public function getRequest()
$secretKey = $this->environment->getSecretKey();

return $this->requestFactory->create(
"/auth/authentication/{$shopId}/secret-key"
'/auth/authentication/' . urlencode($shopId) . '/secret-key'
)->isJson()->getRequest()->withAddedHeader('Authorization', $secretKey);
}
}
6 changes: 3 additions & 3 deletions lib/PaygreenSdk/Payment/V3/Request/Buyer/BuyerRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class BuyerRequest extends \Paygreen\Sdk\Core\Request\Request
public function getGetRequest($buyerId)
{
return $this->requestFactory->create(
"/payment/buyers/" . $buyerId,
'/payment/buyers/' . urlencode($buyerId),
null,
'GET'
)->withAuthorization()->isJson()->getRequest();
Expand Down Expand Up @@ -72,7 +72,7 @@ public function getCreateRequest(BuyerInterface $buyer, $shopId = null)
];

return $this->requestFactory->create(
"/payment/buyers",
'/payment/buyers',
(new Serializer([new CleanEmptyValueNormalizer()], [new JsonEncoder()]))->serialize($body, 'json')
)->withAuthorization()->isJson()->getRequest();
}
Expand Down Expand Up @@ -107,7 +107,7 @@ public function getUpdateRequest(BuyerInterface $buyer)
}

return $this->requestFactory->create(
"/payment/buyers/{$buyer->getId()}",
'/payment/buyers/' . urlencode($buyer->getId()),
(new Serializer([new CleanEmptyValueNormalizer()], [new JsonEncoder()]))->serialize($body, 'json')
)->withAuthorization()->isJson()->getRequest();
}
Expand Down
2 changes: 1 addition & 1 deletion lib/PaygreenSdk/Payment/V3/Request/Event/EventRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function getCreateRequest(
];

return $this->requestFactory->create(
"/events",
'/events',
(new Serializer([new CleanEmptyValueNormalizer()], [new JsonEncoder()]))->serialize($body, 'json')
)->withAuthorization()->isJson()->getRequest();
}
Expand Down
Loading

0 comments on commit 805686c

Please sign in to comment.