Skip to content

Commit 4e71ce6

Browse files
committed
Set transaction ID and complete payment after successfull payment
1 parent 22c369e commit 4e71ce6

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

classes/core/ApplePay.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,12 +184,10 @@ public function applepay_card_wallet_authorize() {
184184
$txn_id = $transaction['TransactionId'];
185185

186186
$order->add_order_note( __( "Gateway Order ID: $order_id", 'altapay' ) );
187-
$order->add_order_note( __( 'Apple Pay payment completed', 'altapay' ) );
188-
$order->payment_complete();
189-
$order->set_transaction_id( $txn_id );
190-
$order->save();
191-
192187
if ( $response->Result === 'Success' ) {
188+
$order->set_transaction_id( $txn_id );
189+
$order->add_order_note( __( 'Apple Pay payment completed', 'altapay' ) );
190+
$order->payment_complete();
193191

194192
$reconciliation = new Core\AltapayReconciliation();
195193
foreach ( $transaction['ReconciliationIdentifiers'] as $val ) {

0 commit comments

Comments
 (0)