Skip to content

Commit

Permalink
Add order tracking endpoint (#648)
Browse files Browse the repository at this point in the history
  • Loading branch information
DMollov authored Sep 11, 2024
1 parent e915979 commit 5bbcec4
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/Traits/PayPalAPI/Orders.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,27 @@ public function capturePaymentOrder(string $order_id, array $data = [])

return $this->doPayPalRequest();
}

/**
* Add tracking information for an Order.
*
* @param string $order_id
* @param array $data
*
* @throws \Throwable
*
* @return array|\Psr\Http\Message\StreamInterface|string
*
* @see https://developer.paypal.com/docs/api/orders/v2/#orders_track_create
*/
public function addTrackingForOrder(string $order_id, array $data)
{
$this->apiEndPoint = "v2/checkout/orders/{$order_id}/track";

$this->options['json'] = $data;

$this->verb = 'post';

return $this->doPayPalRequest();
}
}

1 comment on commit 5bbcec4

@nahid4662
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when i am clicking for payment it shows json_decode error: Syntax error and also not generate the access-token.Please help me

Please sign in to comment.