Page 54 of 58 FirstFirst ... 4445253545556 ... LastLast
Results 531 to 540 of 574
  1. #531
    Join Date
    Jul 2021
    Location
    Fukuoka Japan
    Posts
    125
    Plugin Contributions
    2

    Default Re: Stripe payment module - Duplicate charges, no order

    Return url is not json encoded.
    So script cannot read the PHP return URL

    \www\includes\modules\payment\stripepay\create.php line 63
    add following code
    PHP Code:
    $jason_confirmationULR json_encode($confirmationURL); 
    and rewrite from
    Code:
        var confirmationURL = JSON.parse('<?php echo $confirmationURL; ?>');
    to
    Code:
        var confirmationURL = JSON.parse('<?php echo $jason_confirmationULR; ?>');
    if it's OK.
    could you reply the post?

  2. #532
    Join Date
    May 2010
    Location
    Texas
    Posts
    491
    Plugin Contributions
    0

    Default Re: Stripe payment module - Duplicate charges, no order

    The customer further clarified, that when the first charge occurred, he never was directed to Amazon, it was if the "Edit" button for address had a similar effect as the "Confirm order" button. He said that after changing the address and clicking "Confirm Order", he was then redirected to Amazon; that's when the 2nd charge occurred.

  3. #533
    Join Date
    May 2010
    Location
    Texas
    Posts
    491
    Plugin Contributions
    0

    Default Re: Stripe payment module - Duplicate charges, no order

    Quote Originally Posted by Gozzandes View Post
    Return url is not json encoded.
    So script cannot read the PHP return URL
    I put the changes on my mirrored test site, which operates in Stripe test mode.
    Tried an Amazon Payment
    Pressed the "Confirm Order" button and to the left of it appeared this message:

    You must provide a `return_url` when confirming a PaymentIntent with the payment method type amazon_pay.

    The transaction appeared on Stripe as "Incomplete"
    On Zen, the message disappeared and I remained on the 3rd checkout page as if the "confirm order" button was never pressed

  4. #534
    Join Date
    Jul 2021
    Location
    Fukuoka Japan
    Posts
    125
    Plugin Contributions
    2

    Default Re: Stripe payment module - Duplicate charges, no order

    if you rewrite checkout.jp return_url: confirmationURL, to return_url: https://YOUR DOMEIN/index.php?main_page=checkout_confirmation,
    Please revert this code to return_url: confirmationURL,.

    I've checked live site using Googlepay.
    Payment was made twice, 1st payment is failed and 2nd is succeeded.
    And zen cart was also succeeded.
    It works everything.
    Name:  stripe.jpg
Views: 27
Size:  42.6 KB

  5. #535
    Join Date
    Jul 2021
    Location
    Fukuoka Japan
    Posts
    125
    Plugin Contributions
    2

    Default Re: Stripe payment module - Duplicate charges, no order

    Here's the revised create.php code:

    PHP Code:
    <?php

    require 'vendor/autoload.php';

    \
    Stripe\Stripe::setApiKey($secret_key);

    try {
    global 
    $db,$output,$param_json;
      if (
    $registered_customer == false && $test_mode == false){
     
        
    $customer = \Stripe\Customer::create([
        
    'email' => $email,
        
    'name'   => $fullname,
        ]);

        
    $stripeCustomerID $customer->id;  
        
       
    $sql "INSERT INTO " TABLE_STRIPE " (id,customers_id,Stripe_Customers_id)  VALUES (NULL,:custID, :stripeCID )";
        
    $sql $db->bindVars($sql':custID'$_SESSION['customer_id'], 'integer');
        
    $sql $db->bindVars($sql':stripeCID'$stripeCustomerID'string');
        
    $db->Execute($sql);

    }elseif (
    $test_mode == false){
        
    $stripeCustomerID $stripe_customer->fields['stripe_customers_id'];
    }


      
    // Create a PaymentIntent with amount and currency
    if ($test_mode == false){
        
    $paymentIntent = \Stripe\PaymentIntent::create([
            
    'amount' => $amount_total,
            
    'currency' => $payment_currency,
            
    'customer' => $stripeCustomerID,
            
    'automatic_payment_methods' => [
            
    'enabled' => true,
            ],
        ]);
    }else{
        
    $paymentIntent = \Stripe\PaymentIntent::create([
            
    'amount' => $amount_total,
            
    'currency' => $payment_currency,
            
    'automatic_payment_methods' => [
            
    'enabled' => true,
            ],
        ]);
    }


        
    $output = [
            
    'clientSecret' => $paymentIntent->client_secret,
        ];

        
    $clientS_json json_encode($output); 

    } catch (
    Error $e) {
        
    http_response_code(500);
        
    $clientS_json =json_encode(['error' => $e->getMessage()]);
    }
       
    $jason_publishable_key json_encode($publishable_key);
    $jason_PaymentSuccess json_encode(TEXT_PAYMENT_STRIPE_PAYMENTSUCCEEDED);
    $confirmationURL '"' HTTPS_SERVER DIR_WS_HTTPS_CATALOG 'index.php?main_page=checkout_confirmation"';
    $jason_confirmationURL json_encode($confirmationURL);

    //---comments---
    if($order->info['comments']!=""){
    $order_add_comment $order->info['comments'];
    $_SESSION['order_add_comment'] = $order_add_comment;
    }else{
    $_SESSION['order_add_comment'] = "";
    }
        
    $_SESSION['paymentIntent'] = $paymentIntent['id'];

    //echo $paymentIntent['id'];
    //------------
    ?>
    <script>
       'use strict';
        var clientS = JSON.parse('<?php echo $clientS_json?>'); 
        var PublishableKey = JSON.parse('<?php echo $jason_publishable_key?>'); 
        var confirmationURL = JSON.parse('<?php echo $jason_confirmationURL?>'); 
        var PaymentSuccess = JSON.parse('<?php echo $jason_PaymentSuccess?>'); 

    </script>

  6. #536
    Join Date
    Jul 2021
    Location
    Fukuoka Japan
    Posts
    125
    Plugin Contributions
    2

    Default Re: Stripe payment module - Duplicate charges, no order

    The first pi number is created through create.php.
    The second pi number is created without going through create.php, so I think it is automatically generated by the Stripe server.
    Perhaps the first one was for credit card payment, and the second one was created again to redirect to an external site.
    Well, that's just my guess.

  7. #537
    Join Date
    May 2010
    Location
    Texas
    Posts
    491
    Plugin Contributions
    0

    Default Re: Stripe payment module - Duplicate charges, no order

    I'm not clear what changes are needed. Does checkout.jp and create.php need to change?

  8. #538
    Join Date
    May 2010
    Location
    Texas
    Posts
    491
    Plugin Contributions
    0

    Default Re: Stripe payment module - Duplicate charges, no order

    Quote Originally Posted by Gozzandes View Post
    Here's the revised create.php code:
    I replaced the contents of create.php with the code you just posted and tried it with Amazon Pay. I did not mess with checkout.jp.
    Same issue as before,
    I see the message:
    You must provide a `return_url` when confirming a PaymentIntent with the payment method type amazon_pay.

  9. #539
    Join Date
    Jul 2021
    Location
    Fukuoka Japan
    Posts
    125
    Plugin Contributions
    2

    Default Re: Stripe payment module - Duplicate charges, no order

    Quote Originally Posted by split63 View Post
    I'm not clear what changes are needed. Does checkout.jp and create.php need to change?
    checkout.js should not be changed, it's should be original line 39 return_url: confirmationURL,.

    creat.php line 60 - should be changed
    PHP Code:
    $jason_publishable_key = json_encode($publishable_key);
    $jason_PaymentSuccess = json_encode(TEXT_PAYMENT_STRIPE_PAYMENTSUCCEEDED);
    $confirmationURL = '"' . HTTPS_SERVER . DIR_WS_HTTPS_CATALOG . 'index.php?main_page=checkout_confirmation"';
    $jason_confirmationURL = json_encode($confirmationURL);

    //---comments---
    if($order->info['comments']!=""){
    $order_add_comment = $order->info['comments'];
    $_SESSION['order_add_comment'] = $order_add_comment;
    }else{
    $_SESSION['order_add_comment'] = "";
    }
        $_SESSION['paymentIntent'] = $paymentIntent['id'];

    //echo $paymentIntent['id'];
    //------------
    ?>
    <script>
       'use strict';
        var clientS = JSON.parse('<?php echo $clientS_json?>'); 
        var PublishableKey = JSON.parse('<?php echo $jason_publishable_key?>'); 
        var confirmationURL = JSON.parse('<?php echo $jason_confirmationURL?>'); 
        var PaymentSuccess = JSON.parse('<?php echo $jason_PaymentSuccess?>'); 

    </script>

  10. #540
    Join Date
    Jul 2021
    Location
    Fukuoka Japan
    Posts
    125
    Plugin Contributions
    2

    Default Re: Stripe payment module - Duplicate charges, no order

    Quote Originally Posted by split63 View Post
    I replaced the contents of create.php with the code you just posted and tried it with Amazon Pay. I did not mess with checkout.jp.
    Same issue as before,
    I see the message:
    You must provide a `return_url` when confirming a PaymentIntent with the payment method type amazon_pay.
    following codes are for Amazonpay.
    create.php line 34-36 and 42-44
    from
    PHP Code:
            'automatic_payment_methods' => [
            
    'enabled' => true,
            ], 
    to
    PHP Code:
      payment_method_types: ['card''amazon_pay'], 

 

 
Page 54 of 58 FirstFirst ... 4445253545556 ... LastLast

Similar Threads

  1. pay2check.com payment module?
    By sunrise99 in forum Addon Payment Modules
    Replies: 0
    Last Post: 1 Nov 2011, 03:55 AM
  2. klikandpay.com payment module
    By rulest in forum Addon Payment Modules
    Replies: 0
    Last Post: 24 Sep 2010, 06:06 PM
  3. AlertPay Payment Module Integration Help Please!
    By etorf9751 in forum Addon Payment Modules
    Replies: 8
    Last Post: 16 Aug 2010, 05:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR