Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions paypal/controllers/FrmPayPalLiteActionsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -664,9 +664,9 @@

$captures = $payments->captures;

foreach ( $captures as $capture ) {
return $capture->id;
}

Check warning on line 669 in paypal/controllers/FrmPayPalLiteActionsController.php

View workflow job for this annotation

GitHub Actions / Mago

loop-does-not-iterate

Loop is unconditionally terminated and will not iterate. >This loop will only execute once at most >The loop is exited by this unconditional `return` statement Loops that do not iterate are often misleading and can indicate a logic error or redundant code. Help: Consider refactoring the code. If the loop is intended to run only once, an `if` statement might be clearer.
}

return '';
Expand Down Expand Up @@ -1419,6 +1419,7 @@
'buttonStyle' => self::get_button_style_for_js( $action ),
'imagesUrl' => FrmPayPalLiteAppHelper::plugin_url() . 'images/',
'includeGooglePayApplePay' => $include_google_apple_pay,
'mode' => FrmPayPalLiteAppHelper::active_mode(),
);

wp_localize_script( 'formidable-paypal', 'frmPayPalVars', $paypal_vars );
Expand Down
2 changes: 1 addition & 1 deletion paypal/js/frontend.js
Original file line number Diff line number Diff line change
Expand Up @@ -920,7 +920,7 @@
*/
function getGooglePaymentsClient() {
return new google.payments.api.PaymentsClient( {
environment: 'TEST',
environment: frmPayPalVars.mode === 'test' ? 'TEST' : 'PRODUCTION',
paymentDataCallbacks: {
onPaymentAuthorized
}
Expand Down
Loading