Plugin Directory

Changeset 3386994


Ignore:
Timestamp:
10/30/2025 10:49:48 AM (5 months ago)
Author:
stitchexpress
Message:

1.3.1

Location:
stitch-express
Files:
10 edited
1 copied

Legend:

Unmodified
Added
Removed
  • stitch-express/tags/1.3.1/includes/stitch-express-client.php

    r3235498 r3386994  
    9898        int $amount,
    9999        string $payer_name,
     100        ?string $payer_phone,
     101        ?string $payer_email,
    100102        string $merchant_ref,
    101103        bool $skip_checkout_page
     
    104106            'amount' => $amount,
    105107            'payerName' => $payer_name,
     108            'payerPhoneNumber' => $payer_phone,
     109            'payerEmailAddress' => $payer_email,
    106110            'merchantReference' => $merchant_ref,
    107111            'skipCheckoutPage' => $skip_checkout_page,
  • stitch-express/tags/1.3.1/includes/stitch-express-gateway.php

    r3235498 r3386994  
    116116
    117117        $total_in_cents = (int) ($order->get_total() * 100);
     118
     119        $payer_email = $order->get_billing_email();
     120        $payer_phonenumber = $order->get_billing_phone();
    118121        $customer_name = substr(
    119122            $order->get_billing_first_name().
     
    128131
    129132        try {
    130             $url = $stitch_express_client->create_payment_link($total_in_cents, $customer_name, $merchant_ref, $skip_checkout_page);
     133            $url = $stitch_express_client->create_payment_link($total_in_cents, $customer_name, $payer_phonenumber, $payer_email, $merchant_ref, $skip_checkout_page);
    131134        } catch (Exception $exception) {
    132135            $this->handle_api_error($exception, 'Payment failed. Please try again.');
  • stitch-express/tags/1.3.1/readme.txt

    r3241711 r3386994  
    33Tags: woocommerce, card, payments, south africa, apple pay, google pay, stitch, express, stitch express
    44Tested up to: 6.7
    5 Stable tag: 1.3.0
     5Stable tag: 1.3.1
    66License: GPLv3
    77License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    8383
    8484== Changelog ==
     85= 1.3.1 =
     86* Minor improvements
     87
    8588= 1.3.0 =
    8689* Add refunds
     
    152155
    153156== Upgrade Notice ==
     157= 1.3.1 =
     158* Minor improvements
     159
    154160= 1.3.0 =
    155161* Add refunds
  • stitch-express/tags/1.3.1/stitch-express.php

    r3235503 r3386994  
    99 * Description:          Use Stitch Express to easily and securely accept Card payment on your WooCommerce store.
    1010 * Plugin URI:           https://wordpress.org/plugins/stitchexpress/
    11  * Version:              1.3.0
     11 * Version:              1.3.1
    1212 * Requires at least:    6.5
    1313 * Requires PHP:         8.0
     
    7777    $split_string = explode('-', $reference);
    7878    $order_id = $split_string[1];
     79    $override = $request->get_param('override') === 'true';
    7980
    8081    $order = wc_get_order($order_id);
     
    105106    }
    106107
    107     $order->payment_complete($payment_id);
    108     $order->save();
     108    // Process payment if order is awaiting payment OR override flag is set
     109    // Check both 'awaiting-payment' (plugin custom status) and 'pending' (WooCommerce default)
     110    $is_awaiting_payment = in_array($order->get_status(), ['awaiting-payment', 'pending'], true);
    109111
    110     return stitch_express_generate_webhook_response($order->get_checkout_order_received_url());
     112    if ($is_awaiting_payment || $override) {
     113        $logger->info(
     114            "Marking order {$order_id} with status '{$order->get_status()}' as complete. Stitch Payment ID: {$payment_id}",
     115            ['source' => 'stitch-express']
     116        );
     117
     118        $order->payment_complete($payment_id);
     119        $order->save();
     120
     121        return stitch_express_generate_webhook_response($order->get_checkout_order_received_url());
     122    }
     123
     124    // Skip payment completion to prevent duplicate notifications
     125    $logger->info("Order {$order_id} status is '{$order->get_status()}', skipping payment completion", ['source' => 'stitch-express']);
     126
     127    return stitch_express_generate_webhook_response($order->get_view_order_url());
    111128}
    112129
  • stitch-express/trunk/includes/stitch-express-client.php

    r3235498 r3386994  
    9898        int $amount,
    9999        string $payer_name,
     100        ?string $payer_phone,
     101        ?string $payer_email,
    100102        string $merchant_ref,
    101103        bool $skip_checkout_page
     
    104106            'amount' => $amount,
    105107            'payerName' => $payer_name,
     108            'payerPhoneNumber' => $payer_phone,
     109            'payerEmailAddress' => $payer_email,
    106110            'merchantReference' => $merchant_ref,
    107111            'skipCheckoutPage' => $skip_checkout_page,
  • stitch-express/trunk/includes/stitch-express-gateway.php

    r3235498 r3386994  
    116116
    117117        $total_in_cents = (int) ($order->get_total() * 100);
     118
     119        $payer_email = $order->get_billing_email();
     120        $payer_phonenumber = $order->get_billing_phone();
    118121        $customer_name = substr(
    119122            $order->get_billing_first_name().
     
    128131
    129132        try {
    130             $url = $stitch_express_client->create_payment_link($total_in_cents, $customer_name, $merchant_ref, $skip_checkout_page);
     133            $url = $stitch_express_client->create_payment_link($total_in_cents, $customer_name, $payer_phonenumber, $payer_email, $merchant_ref, $skip_checkout_page);
    131134        } catch (Exception $exception) {
    132135            $this->handle_api_error($exception, 'Payment failed. Please try again.');
  • stitch-express/trunk/readme.txt

    r3241711 r3386994  
    33Tags: woocommerce, card, payments, south africa, apple pay, google pay, stitch, express, stitch express
    44Tested up to: 6.7
    5 Stable tag: 1.3.0
     5Stable tag: 1.3.1
    66License: GPLv3
    77License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    8383
    8484== Changelog ==
     85= 1.3.1 =
     86* Minor improvements
     87
    8588= 1.3.0 =
    8689* Add refunds
     
    152155
    153156== Upgrade Notice ==
     157= 1.3.1 =
     158* Minor improvements
     159
    154160= 1.3.0 =
    155161* Add refunds
  • stitch-express/trunk/stitch-express.php

    r3235503 r3386994  
    99 * Description:          Use Stitch Express to easily and securely accept Card payment on your WooCommerce store.
    1010 * Plugin URI:           https://wordpress.org/plugins/stitchexpress/
    11  * Version:              1.3.0
     11 * Version:              1.3.1
    1212 * Requires at least:    6.5
    1313 * Requires PHP:         8.0
     
    7777    $split_string = explode('-', $reference);
    7878    $order_id = $split_string[1];
     79    $override = $request->get_param('override') === 'true';
    7980
    8081    $order = wc_get_order($order_id);
     
    105106    }
    106107
    107     $order->payment_complete($payment_id);
    108     $order->save();
     108    // Process payment if order is awaiting payment OR override flag is set
     109    // Check both 'awaiting-payment' (plugin custom status) and 'pending' (WooCommerce default)
     110    $is_awaiting_payment = in_array($order->get_status(), ['awaiting-payment', 'pending'], true);
    109111
    110     return stitch_express_generate_webhook_response($order->get_checkout_order_received_url());
     112    if ($is_awaiting_payment || $override) {
     113        $logger->info(
     114            "Marking order {$order_id} with status '{$order->get_status()}' as complete. Stitch Payment ID: {$payment_id}",
     115            ['source' => 'stitch-express']
     116        );
     117
     118        $order->payment_complete($payment_id);
     119        $order->save();
     120
     121        return stitch_express_generate_webhook_response($order->get_checkout_order_received_url());
     122    }
     123
     124    // Skip payment completion to prevent duplicate notifications
     125    $logger->info("Order {$order_id} status is '{$order->get_status()}', skipping payment completion", ['source' => 'stitch-express']);
     126
     127    return stitch_express_generate_webhook_response($order->get_view_order_url());
    111128}
    112129
Note: See TracChangeset for help on using the changeset viewer.