Skip to content

Commit

Permalink
Merge 51f0ec3 into d82936f
Browse files Browse the repository at this point in the history
  • Loading branch information
otnansirk committed Feb 21, 2024
2 parents d82936f + 51f0ec3 commit 2da419e
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions src/Traits/PayPalAPI/Subscriptions/Helpers.php
Expand Up @@ -103,6 +103,8 @@ public function setupSubscription(string $customer_name, string $customer_email,
}

$subscription = $this->createSubscription($body);
$subscription['billing_plan_id'] = $this->billing_plan['id'];
$subscription['product_id'] = $this->product['id'];

unset($this->product);
unset($this->billing_plan);
Expand Down Expand Up @@ -295,7 +297,7 @@ protected function addPlanBillingCycle(string $interval_unit, int $interval_coun
}

return [
'frequency' => [
'frequency' => [
'interval_unit' => $interval_unit,
'interval_count' => $interval_count,
],
Expand Down Expand Up @@ -327,10 +329,10 @@ public function addProduct(string $name, string $description, string $type, stri
$request_id = Str::random();

$this->product = $this->createProduct([
'name' => $name,
'description' => $description,
'type' => $type,
'category' => $category,
'name' => $name,
'description' => $description,
'type' => $type,
'category' => $category,
], $request_id);

return $this;
Expand Down Expand Up @@ -452,16 +454,16 @@ public function addSetupFee(float $price): \Srmklive\PayPal\Services\PayPal
public function addShippingAddress(string $full_name, string $address_line_1, string $address_line_2, string $admin_area_2, string $admin_area_1, string $postal_code, string $country_code): \Srmklive\PayPal\Services\PayPal
{
$this->shipping_address = [
'name' => [
'name' => [
'full_name' => $full_name,
],
'address' => [
'address_line_1' => $address_line_1,
'address_line_2' => $address_line_2,
'admin_area_2' => $admin_area_2,
'admin_area_1' => $admin_area_1,
'postal_code' => $postal_code,
'country_code' => $country_code,
'address_line_1' => $address_line_1,
'address_line_2' => $address_line_2,
'admin_area_2' => $admin_area_2,
'admin_area_1' => $admin_area_1,
'postal_code' => $postal_code,
'country_code' => $country_code,
],
];

Expand Down

0 comments on commit 2da419e

Please sign in to comment.