From 7c131e15ef63784a9a54d9de6503798a162365fb Mon Sep 17 00:00:00 2001 From: Mario Lorenz Date: Fri, 10 Nov 2023 09:37:46 +0100 Subject: [PATCH] add PartnerAttributionId to API-Calls * update * confirm * (re-)authorize * capture * refund --- generated/Service/Orders.php | 40 +++++++++++++++++++++++++++------- generated/Service/Payments.php | 37 ++++++++++++++++++++++++++----- src/Onboarding.php | 5 ----- 3 files changed, 63 insertions(+), 19 deletions(-) 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: * - * @throws ApiException * @return Order + *@throws ApiException */ - public function confirmTheOrder($payPalClientMetadataId, $id, ConfirmOrderRequest $confirmOrderRequest, $prefer = 'return=minimal'): Order + public function confirmTheOrder($payPalClientMetadataId, $id, ConfirmOrderRequest $confirmOrderRequest, string $payPalPartnerAttributionId = '', $prefer = 'return=minimal',): Order { $path = "/orders/{$id}/confirm-payment-source"; @@ -180,6 +186,9 @@ public function confirmTheOrder($payPalClientMetadataId, $id, ConfirmOrderReques $headers['Content-Type'] = 'application/json'; $headers['Prefer'] = $prefer; + if ($payPalPartnerAttributionId) { + $headers['PayPal-Partner-Attribution-Id'] = $payPalPartnerAttributionId; + } $body = json_encode($confirmOrderRequest, true); $response = $this->send('POST', $path, [], $headers, $body); @@ -204,6 +213,8 @@ public function confirmTheOrder($payPalClientMetadataId, $id, ConfirmOrderReques * 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: