Skip to content

Commit

Permalink
Updated OrderPresenter with values for Google Pay
Browse files Browse the repository at this point in the history
  • Loading branch information
L3RAZ committed Jul 9, 2024
1 parent 5194d4b commit e4bd4ba
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/Builder/Payload/OrderPayloadBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,8 @@ private function buildPayPalPaymentSourceNode()
$this->getPayload()->addAndMergeItems($node);
}

private function buildGooglePayPaymentSourceNode() {
private function buildGooglePayPaymentSourceNode()
{
/** @var \Ps_checkout $module */
$module = \Module::getInstanceByName('ps_checkout');
/** @var PayPalConfiguration $paypalConfiguration */
Expand Down
2 changes: 1 addition & 1 deletion src/Checkout/CheckoutChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function continueWithAuthorization($cartId, $orderPayPal)
throw new PsCheckoutException(sprintf('PayPal Order %s is already captured', $orderPayPal['id']));
}

$paymentSource = current(array_keys($orderPayPal['payment_source']));
$paymentSource = key($orderPayPal['payment_source']);

if (in_array($paymentSource, ['card', 'google_pay']) && isset($orderPayPal['payment_source'][$paymentSource])) {
$card3DSecure = (new Card3DSecure())->continueWithAuthorization($orderPayPal);
Expand Down
2 changes: 1 addition & 1 deletion src/PayPal/Card3DSecure.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ private function noLiabilityShift(array $cardAuthenticationResult)
*/
private function getAuthenticationResult(array $order)
{
$fundingSource = current(array_keys($order['payment_source']));
$fundingSource = key($order['payment_source']);

return isset($order['payment_source'][$fundingSource]['authentication_result']) ? $order['payment_source'][$fundingSource]['authentication_result'] : null;
}
Expand Down

0 comments on commit e4bd4ba

Please sign in to comment.