Skip to content

Commit

Permalink
Merge fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
alecritson committed Oct 2, 2023
1 parent 7129be7 commit 4c086d2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 17 deletions.
16 changes: 0 additions & 16 deletions payment/paypal/src/Paypal.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,8 @@ public function buildInitialOrder(Cart $cart): array
$billingAddress = $cart->billingAddress;
$shippingAddress = $cart->shippingAddress ?: $billingAddress;

<<<<<<< HEAD
=======
$successRoute = config('lunar.payments.paypal.success_route', 'checkout.success');

>>>>>>> feat/stripe-refactor
$requestData = [
'intent' => 'CAPTURE',
'purchase_units' => [
Expand Down Expand Up @@ -92,22 +89,13 @@ public function buildInitialOrder(Cart $cart): array
'shipping_preference' => 'SET_PROVIDED_ADDRESS',
'payment_method_preference' => 'IMMEDIATE_PAYMENT_REQUIRED',
'email' => $billingAddress?->contact_email,
<<<<<<< HEAD
'return_url' => route('checkout.success'),
'cancel_url' => route('checkout.index', $cart->fingerprint()),
=======
'return_url' => route($successRoute),
'cancel_url' => route($successRoute, $cart->fingerprint()),
>>>>>>> feat/stripe-refactor
'name' => [
'given_name' => $billingAddress?->first_name,
'surname' => $billingAddress?->last_name,
],
<<<<<<< HEAD
'email_address' => $billingAddress->email,
=======
'email_address' => $billingAddress->contact_email,
>>>>>>> feat/stripe-refactor
'address' => [
'address_line_1' => $billingAddress?->line_one,
'address_line_2' => $billingAddress?->line_two,
Expand All @@ -121,11 +109,7 @@ public function buildInitialOrder(Cart $cart): array
];

return $this->baseHttpClient()->withToken($this->getAccessToken())->withBody(
<<<<<<< HEAD
json_encode($requestData)
=======
json_encode($requestData), 'application/json'
>>>>>>> feat/stripe-refactor
)->post('v2/checkout/orders')->json();
}
}
2 changes: 1 addition & 1 deletion payment/paypal/src/PaypalPaymentType.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function authorize(): PaymentAuthorize

if (isset($paypalOrder['name']) && $paypalOrder['name'] == 'RESOURCE_NOT_FOUND') {
return new PaymentAuthorize(
successful: false,
success: false,
);
}

Expand Down

0 comments on commit 4c086d2

Please sign in to comment.