diff --git a/generated/Service/Orders.php b/generated/Service/Orders.php index 2a68c82..eba13f9 100644 --- a/generated/Service/Orders.php +++ b/generated/Service/Orders.php @@ -111,16 +111,21 @@ public function showOrderDetails($id, $fields): Order * * @param $patchRequest mixed * - * @throws ApiException + * @param $payPalPartnerAttributionId string + * * @return void + *@throws ApiException */ - public function updateOrder($id, array $patchRequest): void + public function updateOrder($id, array $patchRequest, string $payPalPartnerAttributionId = ''): void { $path = "/orders/{$id}"; $headers = []; $headers['Content-Type'] = 'application/json'; + if ($payPalPartnerAttributionId) { + $headers['PayPal-Partner-Attribution-Id'] = $payPalPartnerAttributionId; + } $body = json_encode($patchRequest, true); $response = $this->send('PATCH', $path, [], $headers, $body); @@ -146,7 +151,6 @@ public function validatePaymentMethod($payPalClientMetadataId, $id, OrderValidat $headers['PayPal-Client-Metadata-Id'] = $payPalClientMetadataId; $headers['Content-Type'] = 'application/json'; - $body = json_encode($orderValidateRequest, true); $response = $this->send('POST', $path, [], $headers, $body); $jsonData = json_decode($response->getBody(), true); @@ -162,16 +166,18 @@ public function validatePaymentMethod($payPalClientMetadataId, $id, OrderValidat * * @param $confirmOrderRequest mixed * + * @param $payPalPartnerAttributionId string + * * @param $prefer string The preferred server response upon successful completion of the request. Value * is:
return=minimal
. The server returns a minimal response to optimize communication
* between the API caller and the server. A minimal response includes the id
, status
* and HATEOAS links.return=representation
. The server returns a complete resource
* representation, including the current state of the resource.return=minimal
. The server returns a minimal response to optimize communication
* between the API caller and the server. A minimal response includes the id
, status
@@ -213,7 +224,7 @@ public function confirmTheOrder($payPalClientMetadataId, $id, ConfirmOrderReques
* @throws ApiException
* @return Order
*/
- public function authorizePaymentForOrder($payPalClientMetadataId, $id, OrderAuthorizeRequest $authorizeRequest, $payPalAuthAssertion, $prefer = 'return=minimal'): Order
+ public function authorizePaymentForOrder($payPalClientMetadataId, $id, OrderAuthorizeRequest $authorizeRequest, $payPalAuthAssertion, string $payPalPartnerAttributionId = '', $prefer = 'return=minimal'): Order
{
$path = "/orders/{$id}/authorize";
@@ -223,6 +234,9 @@ public function authorizePaymentForOrder($payPalClientMetadataId, $id, OrderAuth
$headers['PayPal-Auth-Assertion'] = $payPalAuthAssertion;
$headers['Prefer'] = $prefer;
+ if ($payPalPartnerAttributionId) {
+ $headers['PayPal-Partner-Attribution-Id'] = $payPalPartnerAttributionId;
+ }
$body = json_encode($authorizeRequest, true);
$response = $this->send('POST', $path, [], $headers, $body);
@@ -247,6 +261,8 @@ public function authorizePaymentForOrder($payPalClientMetadataId, $id, OrderAuth
* merchant. For details, see PayPal-Auth-Assertion.
*
+ * @param $payPalPartnerAttributionId string
+ *
* @param $prefer string The preferred server response upon successful completion of the request. Value
* is:return=minimal
. The server returns a minimal response to optimize communication
* between the API caller and the server. A minimal response includes the id
, status
@@ -256,7 +272,7 @@ public function authorizePaymentForOrder($payPalClientMetadataId, $id, OrderAuth
* @throws ApiException
* @return Order
*/
- public function capturePaymentForOrder($payPalClientMetadataId, $id, OrderCaptureRequest $orderCaptureRequest, $payPalAuthAssertion, $prefer = 'return=minimal'): Order
+ public function capturePaymentForOrder($payPalClientMetadataId, $id, OrderCaptureRequest $orderCaptureRequest, $payPalAuthAssertion, string $payPalPartnerAttributionId = '', $prefer = 'return=minimal'): Order
{
$path = "/orders/{$id}/capture";
@@ -266,6 +282,9 @@ public function capturePaymentForOrder($payPalClientMetadataId, $id, OrderCaptur
$headers['PayPal-Auth-Assertion'] = $payPalAuthAssertion;
$headers['Prefer'] = $prefer;
+ if ($payPalPartnerAttributionId) {
+ $headers['PayPal-Partner-Attribution-Id'] = $payPalPartnerAttributionId;
+ }
$body = json_encode($orderCaptureRequest, true);
$response = $this->send('POST', $path, [], $headers, $body);
@@ -280,6 +299,8 @@ public function capturePaymentForOrder($payPalClientMetadataId, $id, OrderCaptur
*
* @param $id string The ID of the order to save.
*
+ * @param $payPalPartnerAttributionId string
+ *
* @param $prefer string The preferred server response upon successful completion of the request. Value
* is:return=minimal
. The server returns a minimal response to optimize communication
* between the API caller and the server. A minimal response includes the id
, status
@@ -289,7 +310,7 @@ public function capturePaymentForOrder($payPalClientMetadataId, $id, OrderCaptur
* @throws ApiException
* @return Order
*/
- public function saveOrder($payPalClientMetadataId, $id, $prefer = 'return=minimal'): Order
+ public function saveOrder($payPalClientMetadataId, $id, string $payPalPartnerAttributionId = '', $prefer = 'return=minimal'): Order
{
$path = "/orders/{$id}/save";
@@ -297,6 +318,9 @@ public function saveOrder($payPalClientMetadataId, $id, $prefer = 'return=minima
$headers['PayPal-Client-Metadata-Id'] = $payPalClientMetadataId;
$headers['Prefer'] = $prefer;
+ if ($payPalPartnerAttributionId) {
+ $headers['PayPal-Partner-Attribution-Id'] = $payPalPartnerAttributionId;
+ }
$body = null;
$response = $this->send('POST', $path, [], $headers, $body);
diff --git a/generated/Service/Payments.php b/generated/Service/Payments.php
index ffe2418..3a1c9be 100644
--- a/generated/Service/Payments.php
+++ b/generated/Service/Payments.php
@@ -25,6 +25,8 @@ class Payments extends BaseService
*
* @param $authorizeRequest mixed
*
+ * @param $payPalPartnerAttributionId string
+ *
* @param $prefer string The preferred server response upon successful completion of the request. Value
* is:return=minimal
. The server returns a minimal response to optimize communication
* between the API caller and the server. A minimal response includes the id
, status
@@ -34,7 +36,7 @@ class Payments extends BaseService
* @throws ApiException
* @return Authorization
*/
- public function authorizePayment(AuthorizationRequest $authorizeRequest, $prefer = 'return=minimal'): Authorization
+ public function authorizePayment(AuthorizationRequest $authorizeRequest, string $payPalPartnerAttributionId = '', $prefer = 'return=minimal'): Authorization
{
$path = "/authorizations";
@@ -42,6 +44,9 @@ public function authorizePayment(AuthorizationRequest $authorizeRequest, $prefer
$headers['Content-Type'] = 'application/json';
$headers['Prefer'] = $prefer;
+ if ($payPalPartnerAttributionId) {
+ $headers['PayPal-Partner-Attribution-Id'] = $payPalPartnerAttributionId;
+ }
$body = json_encode($authorizeRequest, true);
$response = $this->send('POST', $path, [], $headers, $body);
@@ -76,6 +81,8 @@ public function showDetailsForAuthorizedPayment($authorizationId): Authorization
*
* @param $capture mixed
*
+ * @param $payPalPartnerAttributionId string
+ *
* @param $prefer string The preferred server response upon successful completion of the request. Value
* is:return=minimal
. The server returns a minimal response to optimize communication
* between the API caller and the server. A minimal response includes the id
, status
@@ -85,7 +92,7 @@ public function showDetailsForAuthorizedPayment($authorizationId): Authorization
* @throws ApiException
* @return Capture
*/
- public function captureAuthorizedPayment($authorizationId, CaptureRequest $capture, $prefer = 'return=minimal'): Capture
+ public function captureAuthorizedPayment($authorizationId, CaptureRequest $capture, string $payPalPartnerAttributionId = '', $prefer = 'return=minimal'): Capture
{
$path = "/authorizations/{$authorizationId}/capture";
@@ -93,6 +100,9 @@ public function captureAuthorizedPayment($authorizationId, CaptureRequest $captu
$headers['Content-Type'] = 'application/json';
$headers['Prefer'] = $prefer;
+ if ($payPalPartnerAttributionId) {
+ $headers['PayPal-Partner-Attribution-Id'] = $payPalPartnerAttributionId;
+ }
$body = json_encode($capture, true);
$response = $this->send('POST', $path, [], $headers, $body);
@@ -115,16 +125,18 @@ public function captureAuthorizedPayment($authorizationId, CaptureRequest $captu
*
* @param $reauthorizeRequest mixed
*
+ * @param $payPalPartnerAttributionId string
+ *
* @param $prefer string The preferred server response upon successful completion of the request. Value
* is:return=minimal
. The server returns a minimal response to optimize communication
* between the API caller and the server. A minimal response includes the id
, status
* and HATEOAS links.return=representation
. The server returns a complete resource
* representation, including the current state of the resource.return=minimal
. The server returns a minimal response to optimize communication
* between the API caller and the server. A minimal response includes the id
, status
@@ -181,7 +198,7 @@ public function voidAuthorizedPayment($authorizationId, $payPalAuthAssertion): v
* @throws ApiException
* @return Capture
*/
- public function captureSavedOrderDirectly(OrderCaptureRequest $capture, $prefer = 'return=minimal'): Capture
+ public function captureSavedOrderDirectly(OrderCaptureRequest $capture, string $payPalPartnerAttributionId = '', $prefer = 'return=minimal'): Capture
{
$path = "/captures";
@@ -189,6 +206,9 @@ public function captureSavedOrderDirectly(OrderCaptureRequest $capture, $prefer
$headers['Content-Type'] = 'application/json';
$headers['Prefer'] = $prefer;
+ if ($payPalPartnerAttributionId) {
+ $headers['PayPal-Partner-Attribution-Id'] = $payPalPartnerAttributionId;
+ }
$body = json_encode($capture, true);
$response = $this->send('POST', $path, [], $headers, $body);
@@ -231,6 +251,8 @@ public function showCapturedPaymentDetails($captureId): Capture
* must identify the merchant using either a PayPal-Auth-Assertion header or an access token with
* target_subject.
*
+ * @param $payPalPartnerAttributionId string
+ *
* @param $prefer string The preferred server response upon successful completion of the request. Value
* is:return=minimal
. The server returns a minimal response to optimize communication
* between the API caller and the server. A minimal response includes the id
, status
@@ -240,7 +262,7 @@ public function showCapturedPaymentDetails($captureId): Capture
* @throws ApiException
* @return Refund
*/
- public function refundCapturedPayment($captureId, RefundRequest $refundRequest, $payPalAuthAssertion, $prefer = 'return=minimal'): Refund
+ public function refundCapturedPayment($captureId, RefundRequest $refundRequest, $payPalAuthAssertion, string $payPalPartnerAttributionId = '', $prefer = 'return=minimal'): Refund
{
$path = "/captures/{$captureId}/refund";
@@ -249,6 +271,9 @@ public function refundCapturedPayment($captureId, RefundRequest $refundRequest,
$headers['PayPal-Auth-Assertion'] = $payPalAuthAssertion;
$headers['Prefer'] = $prefer;
+ if ($payPalPartnerAttributionId) {
+ $headers['PayPal-Partner-Attribution-Id'] = $payPalPartnerAttributionId;
+ }
$body = json_encode($refundRequest, true);
$response = $this->send('POST', $path, [], $headers, $body);
diff --git a/src/Onboarding.php b/src/Onboarding.php
index 57696dd..c5dcac6 100644
--- a/src/Onboarding.php
+++ b/src/Onboarding.php
@@ -2,11 +2,6 @@
namespace OxidSolutionCatalysts\PayPalApi;
-use OxidSolutionCatalysts\PayPalApi\Model\Partner\Operation;
-use OxidSolutionCatalysts\PayPalApi\Model\Partner\ReferralData;
-use OxidSolutionCatalysts\PayPalApi\Model\Partner\RestApiIntegration;
-use OxidSolutionCatalysts\PayPalApi\Model\Partner\RestApiIntegrationFirstPartyDetails;
-use OxidSolutionCatalysts\PayPalApi\Service\Partner;
use Psr\Log\LoggerInterface;
class Onboarding extends Client