paymnet plugin

Discussion in 'Payments processing' started by ghost, May 10, 2004.

  1. ghost

    ghost New Member

    Joined:
    Oct 23, 2002
    Messages:
    23
    Hi,
    I make a new payment plugin. Could you help me to check what I missed. After go to the payment, it returns successful. It went to the successful page but the payment status is NO and the Receipt # is nothing. Is it auotmatically update the status when the payment is completed?

    Below is the part of my script:
    class payment_paydollar extends payment {
    function do_payment($payment_id, $member_id, $product_id,
    $price, $begin_date, $expire_date, &$vars){

    global $config;
    global $db;
    $products = $product_id;
    $payment = $db->get_payment($payment_id);
    $orig_product_id = $product_id;
    if (is_array($product_id))
    $product_id = $product_id[0];

    $product = & get_product($product_id);
    if (count($orig_product_id)>1)
    $product->config['title'] = $config['multi_title'];

    $u = & $db->get_user(intval($member_id));

    $vars = array(
    'merchantId' => $this->config['merchantid'],
    'currCode' => $this->config['currcode'],
    'payType' => $this->config['paytype'],
    'cancelUrl' => $this->config['cancelurl'],
    'failUrl' => $this->config['failurl'],
    'successUrl' => $this->config['successurl'],
    'amount' => sprintf('%.2f', $price),
    'orderRef' => $payment_id,
    'remark' => $member_id." | ".$product_id." | ".urlencode($product->config['title']),
    'member_id' => $member_id,
    'user_lv' => substr($u['data']['level_id'],3,1)
    );
    // add currency code
    if (strlen($product->config['paypal_currency'])){
    $vars['currency_code'] = $product->config['paypal_currency'];
    };

    $vars1 = array();
    foreach ($vars as $kk=>$vv){
    $v = urlencode($vv);
    $k = urlencode($kk);
    $vars1[] = "$kk=$vv";
    }
    $vars = join('&', $vars1);
    header("Location: https://test.xxxxxxxx.com/b2cDemo/eng/payment/payForm.jsp?".$vars);
    exit();
    }
    }

    Thanks
    KC
  2. alex

    alex aMember Pro Customer Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,021
    You've missed response handling part of plugin. For example, in PayPal plugin it is file ipn.php
    It is most important, hard to create and test part of the plugin.
  3. ghost

    ghost New Member

    Joined:
    Oct 23, 2002
    Messages:
    23
    Payment Plugin

    IT's A GREAT HELP!

Share This Page