wallet using e-comm

Events happening in the community are now at Drupal community events on www.drupal.org.
Nabulaer's picture

hi,
I am new to this group and need some help , after searching and could not find an answer.

I am creating a wallet system using ecommerce that allow a user to transfer credits from one account to another. I also created a payment module for my gateway.

after depositing money to the account , I want to allow withdraw from the sub site account back to the main site so you can transfer it to another sub site account , I am using userpoints to manage the main site balance.
I have created a product from the donate product that allow you specify how much to tranfer as long as it is in the amount of sub site balance range. now the problem.

when that product is added to the cart , I want it to use a specific new payment method that I create and not allow the player to choose from all the payment methods that exist , how do I do that ?

in hook_checkoutapi , the $txn come without the payment_method field , and if I add it , it is not saved, have tried :

<?php
switch ($op) {
    case
'form':
     if(
$txn->payment_method !== 'withdarw'){
     
$txn->payment_method = 'withdraw';
       
$txn->screen = count ($txn->screens)-1; // this is to skip all screens to the end
       
store_transaction_save($txn);
      
drupal_set_message(' <b> DEBUG </b>  withdraw_checkoutapi switch case:' . $op . '<br /> <pre> ' . print_r($txn,true) . '</pre>');
     
drupal_goto('cart/review' ,'op=next');
        }
       return ;    
    
break;
?>

any help is much appreciated

Comments

Don't do this in v3, it will

gordon's picture

Don't do this in v3, it will not handle this in a very good way and give auditors heart attaches.

Look at v4's ec_receipt which will allow you to allocate the payment to the transfer and then create a new receipt on the other customer so it can be all tracked.

--
Gordon Heydon

I am trying very hard to

Nabulaer's picture

I am trying very hard to find information on how to do this.
Can you help in pointing me to the direction of finding info on new things since version 3 , like allocation , product features receipt ?

I am trying to convert my payment module from verison 3 to the latest.

Look on

gordon's picture

Look on http://drupalecommerce.org/api where we have been trying to get all the documentation up to scratch.

--
Gordon Heydon

thanks,

Nabulaer's picture

is upgrading to v4 simple ? (install scripts ready?)

since it is alpha , can it handle production site yet ?

e-Commerce Module

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: