Page 6 of 7 FirstFirst ... 4567 LastLast
Results 51 to 60 of 64
  1. #51
    Join Date
    Jul 2008
    Posts
    360
    Plugin Contributions
    0

    Default Re: Create a new module for International Checkout payment module

    Quote Originally Posted by DrByte View Post
    LOL - sounds like it is absolutely interfering with the standard checkout process, by bypassing it entirely!
    I don't know how GC does it.
    The PayPal button is simply drawn within the template where it's required.
    Lol, it does

    ok, so that's std way GC process_button() is empty!

    BTW is there an easier such as writing the code in a separate file and require it or inside the class?

    Because in my case I just need to write button the way Paypal does, but there is no need for a handler.

  2. #52
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Create a new module for International Checkout payment module

    I don't see why you couldn't do it that way.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #53
    Join Date
    Jul 2008
    Posts
    360
    Plugin Contributions
    0

    Default Re: Create a new module for International Checkout payment module

    Quote Originally Posted by DrByte View Post
    I don't see why you couldn't do it that way.
    I read Paypal files, and the Paypal template button file, and is calling ipn_main_handler.php, linking to it,

    HTML Code:
    <div id="PPECbutton" class="buttonRow">
      <a href="<?php echo zen_href_link('ipn_main_handler.php', 'type=ec', 'SSL', true, true, true); ?>"><img src="<?php echo MODULE_PAYMENT_PAYPALWPP_EC_BUTTON_IMG ?>" alt="<?php echo MODULE_PAYMENT_PAYPALWPP_TEXT_BUTTON_ALTTEXT; ?>" /></a>
    </div>
    so in my case do you you think if I link directly to my payment class will work? Won't it try to write to CONFIGURE table and return an error?

    I know you can instantiate a class, but my understanding of PHP Objects is still limited, so I am not sure how that will behave, If that specific method will make a new conflict ... or if I can have new instance, and don't worry about it ...
    Last edited by icecold; 6 Apr 2010 at 12:27 AM.

  4. #54
    Join Date
    Jul 2008
    Posts
    360
    Plugin Contributions
    0

    Default Re: Create a new module for International Checkout payment module

    Quote Originally Posted by icecold View Post
    I read Paypal files, and the Paypal template button file, and is calling ipn_main_handler.php, linking to it,

    so in my case do you you think if I link directly to my payment class will work? Won't it try to write to CONFIGURE table and return an error?

    I know you can instantiate a class, but my understanding of PHP Objects is still limited, so I am not sure how that will behave, If that specific method will make a new conflict ... or if I can have new instance, and don't worry about it ...

    Sorry I forgot to mention this code is inside Paypal's button template, the tpl_shopping_cart_default, just links to this template.

  5. #55
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Create a new module for International Checkout payment module

    Yes, but that's just the URL that the button goes to when you click it. You don't need to use ipn_main_handler or anything like that. Use whatever you want for your unique needs. PayPal does way more than what you're talking about, so has only marginal similarities to your needs.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  6. #56
    Join Date
    Jul 2008
    Posts
    360
    Plugin Contributions
    0

    Default Re: Create a new module for International Checkout payment module

    Quote Originally Posted by DrByte View Post
    Yes, but that's just the URL that the button goes to when you click it. You don't need to use ipn_main_handler or anything like that. Use whatever you want for your unique needs. PayPal does way more than what you're talking about, so has only marginal similarities to your needs.
    ok I managed to display the nice button ... but when I click the link I got a permission problem ...

    Access forbidden!

    You don't have permission to access the requested object. It is either read-protected or not readable by the server.

    If you think this is a server error, please contact the webmaster.
    Error 403
    www.store.com
    04/06/10 00:22:47
    Apache/2.2.3 (Win32) DAV/2 mod_ssl/2.2.3 OpenSSL/0.9.8c mod_autoindex_color PHP/5.1.6

  7. #57
    Join Date
    Jul 2008
    Posts
    360
    Plugin Contributions
    0

    Default Re: Create a new module for International Checkout payment module

    Quote Originally Posted by icecold View Post
    ok I managed to display the nice button ... but when I click the link I got a permission problem ...

    Access forbidden!

    You don't have permission to access the requested object. It is either read-protected or not readable by the server.

    If you think this is a server error, please contact the webmaster.
    Error 403
    www.store.com
    04/06/10 00:22:47
    Apache/2.2.3 (Win32) DAV/2 mod_ssl/2.2.3 OpenSSL/0.9.8c mod_autoindex_color PHP/5.1.6
    I fixed the problem but now I get a blank page I created a handler, where the class is instantiated and echoed some vars inside the class, but the output is a black screen ...

    I draw the button and call the handler using a link

    HTML Code:
    <div id="ICbutton" class="buttonRow">
      <a href="<?php echo zen_href_link('ic_main_handler.php', 'type=ic', 'NONSSL', true, true, true); ?>"><img src="<?php echo MODULE_PAYMENT_IC_BUTTON_IMG; ?>" alt="<?php echo MODULE_PAYMENT_IC_TEXT_BUTTON_ALTTEXT; ?>" /></a>
    </div>

    Here is my handler's code(I am not sure those requires are needed, tested both ways and same result, blank page):

    PHP Code:
    /**
     * handle International Checkout processing:
     */
    if (isset($_GET['type']) && $_GET['type'] == 'ic') {
      
    // this is an ic handler request
    //  require('includes/application_top.php');
    //  require(DIR_WS_CLASSES . 'payment.php');
     
      // See if the ic module is enabled.
      
    if (defined('MODULE_PAYMENT_IC_STATUS') && MODULE_PAYMENT_IC_STATUS == 'True') {
        
    $ic_module 'ic';
        
    // init the payment object
        
    $payment_modules = new ic();
        
    $payment_modules->ic();
        
    //Test class internal vars
        
        
    echo $payment_modules->test// Test variable assigned with a value to check output
        
    echo $payment_modules->code;
        echo 
    $payment_modules->title;
        echo 
    $payment_modules->description;
        echo 
    $payment_modules->enabled;
        
        
       
       
        }
      } 
    I even created a $test var inside the class and echoed it in the handler along with some variables, to see if I can get some output but it's not working ...

  8. #58
    Join Date
    Jul 2008
    Posts
    360
    Plugin Contributions
    0

    Default Re: Create a new module for International Checkout payment module

    I can't get any values from the vars inside the shopping cart, inside my method process_button I tested the $_SESSION['cart'] and it returned true for both is set and is an object ...
    but $products is still empty ...

    PHP Code:
     function process_button() {
        global 
    $products$currencies;
        
    //Test and return
          
    if (isset($_SESSION['cart'])) {echo 'Session variable is already created.';}
    else {echo 
    'Session variable is not yet created.';}
    if (
    is_object($_SESSION['cart'])) {echo 'Session variable is an object type.';}
    else {echo 
    'Session variable is not an object type.';} 
        echo
    "<br />";
       
       
        
    $products $_SESSION['cart']->get_products();
        echo 
    $products
        return; 
    // test if anything is inside $products so far is empty 

  9. #59
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Create a new module for International Checkout payment module

    get_products() will return an array ... which you can't display by merely using echo(). You would need to echo print_r($products, TRUE) if you wanted to see the array contents that way
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  10. #60
    Join Date
    Jul 2008
    Posts
    360
    Plugin Contributions
    0

    Default Re: Create a new module for International Checkout payment module

    Quote Originally Posted by DrByte View Post
    get_products() will return an array ... which you can't display by merely using echo(). You would need to echo print_r($products, TRUE) if you wanted to see the array contents that way
    ok, I
    made a modification but now I don't get anything from that function ...

    PHP Code:
    function process_button() {
                global 
    $products$currencies$results;

                if (isset(
    $_SESSION['cart'])) {
                    echo 
    'Session variable is already created.';
                } else {  
                    echo 
    'Session variable is not yet created.';
                }
                if (
    is_object($_SESSION['cart'])) {
                    echo 
    'Session variable is an object type.';
                } else { 
                    echo 
    'Session variable is not an object type.';
                } 
              
           echo
    "<br />";   
                
    $products $_SESSION['cart']->get_products();  
                
    $results print_r($productstrue);
                echo 
    $results;
                return;  

            } 
    I am getting an empty string ... so far ...
    My output is:

    ic
    Admin title for the module International Checkout Payments
    Admin description for the module International Checkout Payments
    True, the number 1 means is enabled
    products in cart:


    and it's coming from my modified Paypal IPN handler

    PHP Code:
    if (isset($_GET['type']) && $_GET['type'] == 'ic') {
      
    // this is an ic handler request
     
    require_once('includes/modules/payment/ic.php');
     
    //require_once('includes/modules/pages/shopping_cart/header_php.php');
     
    require('includes/application_top.php');
     require(
    DIR_WS_CLASSES 'payment.php');
     include(
    'includes/languages/english/modules/payment/ic.php');
     
      
    // See if the ic module is enabled.
      
    if (defined('MODULE_PAYMENT_IC_STATUS') && MODULE_PAYMENT_IC_STATUS == 'True') {
        
    $ic_module 'ic';
        
    // init the payment object
        
    $payment_modules = new ic();
        
    $payment_modules->ic();
        
    //Test class internal vars
        
        //$products=$_SESSION['cart'];
        //echo $products;
        
    echo $payment_modules->code "<br />";
        echo 
    "Admin title for the module " $payment_modules->title "<br />";
        echo 
    "Admin description for the module " $payment_modules->description "<br />";
        echo 
    "True, the number " $payment_modules->enabled " means is enabled<br />";
        echo 
    "products in cart: " $payment_modules->results "<br />";
        
        
       
       
        }
      } 

 

 
Page 6 of 7 FirstFirst ... 4567 LastLast

Similar Threads

  1. How to create new payment module?
    By Macedonium in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 15 May 2009, 09:47 PM
  2. Create payment module for cc gateway
    By ccppll in forum Built-in Shipping and Payment Modules
    Replies: 7
    Last Post: 22 Apr 2009, 05:00 PM
  3. How to Create a Transaction ID for Payment Module?
    By Diego Vieira in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 21 Mar 2009, 04:40 PM
  4. How to create new payment module?
    By mscro in forum Built-in Shipping and Payment Modules
    Replies: 9
    Last Post: 28 Apr 2008, 12:23 AM
  5. How do I create a new payment module?
    By meeven in forum Built-in Shipping and Payment Modules
    Replies: 7
    Last Post: 12 Aug 2007, 01:29 PM

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