Skip to content

Commit ac52d42

Browse files
committed
refactor: convert Bizum/PayPal classic params to camelCase
- wp_localize_script: account_id → accountId, session_id → sessionId, bizum_style → bizumStyle, paypal_style → paypalStyle - Updated JS refs in monei-bizum-classic.js, monei-paypal-classic.js - DB option keys remain snake_case for compatibility
1 parent 7eab4e3 commit ac52d42

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

assets/js/monei-bizum-classic.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,11 @@
134134
},
135135
instantiate_payment_request() {
136136
const paymentRequest = monei.Bizum( {
137-
accountId: wc_bizum_params.account_id,
138-
sessionId: wc_bizum_params.session_id,
137+
accountId: wc_bizum_params.accountId,
138+
sessionId: wc_bizum_params.sessionId,
139139
amount: parseInt( wc_bizum_form.total ),
140140
currency: wc_bizum_params.currency,
141-
style: wc_bizum_params.bizum_style || {},
141+
style: wc_bizum_params.bizumStyle || {},
142142
onSubmit( result ) {
143143
$( '#place_order' ).prop( 'disabled', false );
144144
wc_bizum_form.request_token_handler( result.token );

assets/js/monei-paypal-classic.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,12 @@
134134
},
135135
instantiate_payment_request() {
136136
const paymentRequest = monei.PayPal( {
137-
accountId: wc_paypal_params.account_id,
138-
sessionId: wc_paypal_params.session_id,
137+
accountId: wc_paypal_params.accountId,
138+
sessionId: wc_paypal_params.sessionId,
139139
amount: parseInt( wc_paypal_form.total ),
140140
currency: wc_paypal_params.currency,
141141
language: wc_paypal_params.language,
142-
style: wc_paypal_params.paypal_style || {},
142+
style: wc_paypal_params.paypalStyle || {},
143143
onSubmit( result ) {
144144
$( '#place_order' ).prop( 'disabled', false );
145145
wc_paypal_form.request_token_handler( result.token );

src/Gateways/PaymentMethods/WCGatewayMoneiBizum.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -238,12 +238,12 @@ public function bizum_scripts() {
238238
'woocommerce_monei-bizum',
239239
'wc_bizum_params',
240240
array(
241-
'account_id' => $this->getAccountId(),
242-
'session_id' => WC()->session->get_customer_id(),
243-
'total' => monei_price_format( $total ),
244-
'currency' => get_woocommerce_currency(),
245-
'language' => locale_iso_639_1_code(),
246-
'bizum_style' => json_decode( $bizum_style ),
241+
'accountId' => $this->getAccountId(),
242+
'sessionId' => WC()->session->get_customer_id(),
243+
'total' => monei_price_format( $total ),
244+
'currency' => get_woocommerce_currency(),
245+
'language' => locale_iso_639_1_code(),
246+
'bizumStyle' => json_decode( $bizum_style ),
247247
)
248248
);
249249
}

src/Gateways/PaymentMethods/WCGatewayMoneiPaypal.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -242,12 +242,12 @@ public function paypal_scripts() {
242242
'woocommerce_monei-paypal',
243243
'wc_paypal_params',
244244
array(
245-
'account_id' => $this->getAccountId(),
246-
'session_id' => WC()->session->get_customer_id(),
247-
'total' => monei_price_format( $total ),
248-
'currency' => get_woocommerce_currency(),
249-
'language' => locale_iso_639_1_code(),
250-
'paypal_style' => json_decode( $paypal_style ),
245+
'accountId' => $this->getAccountId(),
246+
'sessionId' => WC()->session->get_customer_id(),
247+
'total' => monei_price_format( $total ),
248+
'currency' => get_woocommerce_currency(),
249+
'language' => locale_iso_639_1_code(),
250+
'paypalStyle' => json_decode( $paypal_style ),
251251
)
252252
);
253253
}

0 commit comments

Comments
 (0)