Skip to content

Commit

Permalink
Fix pay button visibility on country switch.
Browse files Browse the repository at this point in the history
  • Loading branch information
iamdharmesh committed Jan 23, 2024
1 parent 718b9c2 commit 708c537
Show file tree
Hide file tree
Showing 3 changed files with 142 additions and 196 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,8 @@ jQuery( document ).ready( ( $ ) => {
* @since x.x.x
*/
constructor( args ) {
if ( false === args.payment_request ) {
return;
}

this.args = args;
this.payment_request = args.payment_request;
this.total_amount = args.payment_request.total.amount;
this.payment_request = args.payment_request || {};
this.isPayForOrderPage = args.is_pay_for_order_page;
this.orderId = args.order_id;
this.id_dasherized = args.gateway_id_dasherized;
Expand All @@ -34,10 +29,6 @@ jQuery( document ).ready( ( $ ) => {
this.cashAppButton = '#wc-square-cash-app';
this.settingUp = false;

if ( $( this.cashAppButton ).length === 0 ) {
return;
}

this.build_cash_app();
this.attach_page_events();
}
Expand All @@ -48,8 +39,9 @@ jQuery( document ).ready( ( $ ) => {
* @since x.x.x
*/
build_cash_app() {
// if we are already setting up, bail.
if ( this.settingUp ) {
console.log( '[Square Cash App Pay] Building Cash App Pay' );
// if we are already setting up or no cash app button, bail.
if ( this.settingUp || $( document ).find( this.cashAppButton ).length === 0 ) {
return;
}

Expand Down
124 changes: 0 additions & 124 deletions includes/Gateway/Cash_App_Pay_Payment_Form.php

This file was deleted.

Loading

0 comments on commit 708c537

Please sign in to comment.