Jump to content
debutpre

CashU payment module

Recommended Posts

Step by Step ;-)

Step 1 :
( a part of paypal's module i edited it )

<?php

class Cashu extends PaymentModule
{
   private    $_html = '';
   private $_postErrors = array();

   public function __construct()
   {
       $this->name = 'cashu';
       $this->tab = 'Payment';
       $this->version = '0.1';

       $this->currencies = true;
       $this->currencies_mode = 'radio';

       parent::__construct();

       /* The parent construct is required for translations */
       $this->page = basename(__FILE__, '.php');
       $this->displayName = $this->l('Cashu');
       $this->description = $this->l('Accepts payments by Cashu');
       $this->confirmUninstall = $this->l('Are you sure you want to delete your details ?');

Share this post


Link to post
Share on other sites

For install
Paypal :

    public function install()
   {
       if (!parent::install()
           OR !Configuration::updateValue('PAYPAL_BUSINESS', 'paypal@prestashop.com')
           OR !Configuration::updateValue('PAYPAL_SANDBOX', 1)
           OR !$this->registerHook('payment')
           OR !$this->registerHook('paymentReturn'))
           return false;
       return true;
   }



Protx :

    public function install()
   {
       if (!parent::install() OR !Configuration::updateValue('VSP_DIRECT_MODE', 'simulator') OR !Configuration::updateValue('VSP_Validate_billing', '0') OR !Configuration::updateValue('VSP_DIRECT_CURRENCY', 1) OR !Configuration::updateValue('VSP_DIRECT_AVSCV2', 1) OR !Configuration::updateValue('VSP_DIRECT_ThreeDSecure', 0) OR !Configuration::updateValue('VSP_DIRECT_VENDOR_NAME', 'test') OR !Configuration::updateValue('VSP_DIRECT_VENDOR_EMAIL', 'root@localhost') OR !Configuration::updateValue('VSP_DIRECT_TXTYPE', 'PAYMENT')
           OR !$this->registerHook('payment') OR !$this->registerHook('paymentReturn'))
           return false;
       return true;
   }

Share this post


Link to post
Share on other sites

For uninstall

Paypal:

    public function uninstall()
   {
       if (!Configuration::deleteByName('PAYPAL_BUSINESS')
           OR !Configuration::deleteByName('PAYPAL_SANDBOX')
           OR !parent::uninstall())
           return false;
       return true;
   }




Protx :

    public function uninstall()
   {
       if (!Configuration::deleteByName('VSP_DIRECT_MODE') OR !Configuration::deleteByName('VSP_Validate_billing') OR !Configuration::deleteByName('VSP_DIRECT_CURRENCY') OR !Configuration::deleteByName('VSP_DIRECT_AVSCV2') OR !Configuration::deleteByName('VSP_DIRECT_ThreeDSecure')
           OR !Configuration::deleteByName('VSP_DIRECT_VENDOR_NAME') OR !Configuration::deleteByName('VSP_DIRECT_VENDOR_EMAIL') OR !Configuration::deleteByName('VSP_DIRECT_TXTYPE') OR !parent::uninstall())
           return false;
       return true;
   }

22917_LDyKfH5zZYqw9dF2tGFr_t

22918_ZoMBiyekcAoGMwIhYV7x_t

Share this post


Link to post
Share on other sites

According to Cashu integration guide we should fill :

1: merchant_id
2: amount
3: currency
4: language
5: display_text
6: txt1
7: token
8: test_mode

so i think that output code can be :

install :

    public function install()
   {
       if (!parent::install()
           OR !Configuration::updateValue('merchant_id')
           OR !Configuration::updateValue('amount')
           OR !Configuration::updateValue('currency')
           OR !Configuration::updateValue('language')
           OR !Configuration::updateValue('display_text')
           OR !Configuration::updateValue('txt1')
           OR !Configuration::updateValue('token')
           OR !Configuration::updateValue('test_mode', 1')
           OR !$this->registerHook('merchant_id')
           OR !$this->registerHook('amount')
           OR !$this->registerHook('currency')
           OR !$this->registerHook('language')
           OR !$this->registerHook('display_text')
           OR !$this->registerHook('txt1')
           OR !$this->registerHook('token')
           /* Accepted values are: “1” for the test mode and “0” for the live mode. */
           OR !$this->registerHook('test_mode', 1')
           return false;
       return true;
   }

Share this post


Link to post
Share on other sites

For uninstall :

   public function uninstall()
   {
       if (!Configuration::deleteByName('merchant_id')
           OR !Configuration::deleteByName('amount')
           OR !Configuration::deleteByName('currency')
           OR !Configuration::deleteByName('language')
           OR !Configuration::deleteByName('display_text')
           OR !Configuration::deleteByName('txt1')
           OR !Configuration::deleteByName('token')
           OR !Configuration::deleteByName('test_mode')
           OR !parent::uninstall())
           return false;
       return true;
   }

Share this post


Link to post
Share on other sites

Below is a description of optional parameters that cashU provides for Merchants to include any data
related to the payment transaction and needed to be passed to the Return URL ( according to Cashu integration guide )

22919_7lVaud2Eph6OoACiQonX_t

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More