Skip to content

Commit

Permalink
🐛 FIX: Always use Stripe
Browse files Browse the repository at this point in the history
  • Loading branch information
austinginder committed Jul 1, 2024
1 parent 7ea2ae2 commit 4fc1d4b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions app/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,7 @@ public function update_payment_method( $invoice_id, $payment_id ) {
'source_object' => $source_object,
];

$available_gateways = WC()->payment_gateways->get_available_payment_gateways();
$payment_method = isset( $available_gateways[ 'stripe' ] ) ? $available_gateways[ 'stripe' ] : false;
$payment_method = WC()->payment_gateways()->payment_gateways()['stripe'];
$order = wc_get_order( $invoice_id );
$payment_method->save_source_to_order( $order, $prepared_source );

Expand Down Expand Up @@ -346,8 +345,7 @@ public function pay_invoice( $invoice_id, $payment_id ) {
'source_object' => $source_object,
];

$available_gateways = WC()->payment_gateways->get_available_payment_gateways();
$payment_method = isset( $available_gateways[ 'stripe' ] ) ? $available_gateways[ 'stripe' ] : false;
$payment_method = WC()->payment_gateways()->payment_gateways()['stripe'];
$order = wc_get_order( $invoice_id );

if ( ! empty( $source_object->error ) && $source_object->error->code == "resource_missing" ) {
Expand Down

0 comments on commit 4fc1d4b

Please sign in to comment.