Search code examples
codeigniterpaypalrecurring-billing

How to Setup Recurring Payments


How can i integrate recurring payment in paypal using codeigniter platform.Can anybody share some good tutorial for this.


Solution

  •  <form id="fPayPal" method="post" name="paypal_form" action="<?= $paypal_url ?>" style="display: none">
    <!-- PayPal Configuration --> 
    <input type="text" name="business" value="<?= $this->prepareToDisaplay($settings_list['PayPalEmail']->Value) ?>"> <br />
    <?php if($recurring) { ?>
        <input type="text" name="cmd" value="_xclick-subscriptions"><br/>
        <input type="text" name="a3" value="<?= $camp_member_info->Total ?>"><br/>
        <input type="text" name="p3" value="1"><br/>
        <input type="text" name="t3" value="M"><br/>
        <input type="text" name="src" value="1"><br/>
        <input type="text" name="srt" value="<?= $month_count ?>"><br/>
    <?php } else { ?>
        <input type="text" name="cmd" value="_xclick"> <br />
    <?php } ?>
    
    <input type="text" name="custom" value="<?= $camp_member_info->ID ?>" /><br />
    <input type="text" name="shopping_url" value="<?= esc_url(get_permalink()) ?>" /><br /><br />
    <input type="text" name="return" value="<?= esc_url($this->get_front_url('paypal-thankyou', $location_id, $price_id)) ?>" /><br />
    <br />
    <input type="text" name="rm" value="2"><br />
    <input type="text" name="currency_code" value="USD"><br />
    <input type="text" name="lc" value="US"><br />
    <input type="text" name="bn" value="toolkit-php"><br />
    <input type="text" name="cbt" value="Continue"><br /><br />
    
    <!-- Payment Page Information --> 
    <input type="text" name="no_shipping" value=""><br />
    <input type="text" name="no_note" value="1"><br />
    <input type="text" name="cn" value="Comments"> <br />
    <input type="text" name="cs" value=""><br /><br />
    
    <!-- Product Information --> 
    <input type="text" name="item_name" value="<?= $this->prepareToDisaplay($price->Name) ?>" /><br />
    <input type="text" name="amount" value="<?= $this->prepareToDisaplay($camp_member_info->Price) ?>" /><br />
    <input type="text" name="quantity" value="1" /><br />
    <?php if($coupon !== null) { ?>
        <input type="text" name="discount_amount" value="<?= $this->prepareToDisaplay($camp_member_info->Discount) ?>" /><br />
    <?php } ?>
    
    <br />
    
    <!-- Customer Information --> 
    <input type="text" name="email" value="<?= $this->prepareToDisaplay($member->Email) ?>" /><br />
    <input type="text" name="first_name" value="<?= $this->prepareToDisaplay($member->FirstName) ?>" /><br />
    <input type="text" name="last_name" value="<?= $this->prepareToDisaplay($member->LastName) ?>" /><br />
    <input type="text" name="address1" value="<?= $this->prepareToDisaplay($member->Address1) ?>" /><br />
    <input type="text" name="address2" value="<?= $this->prepareToDisaplay($member->Address2) ?>" /><br />
    <input type="text" name="state" value="<?= $this->prepareToDisaplay($member->State) ?>" /><br />
    <input type="text" name="city" value="<?= $this->prepareToDisaplay($member->City) ?>" /><br />
    <input type="text" name="zip" value="<?= $this->prepareToDisaplay($member->Zip) ?>" /><br /><br />
    
    
    
    <input type="submit" value="PP" /><br />
    

    /////////////////////////////////////////////////////////////////////

    a3 = amount of ONE billing period
    t3 = time period (M - month, D - day, etc...)
    p3 = number of time periods in billing period
    src = 1 (1 - for recuring payments)
    srt = number of billing periods
    
    Description: a3 dollars, each p3 t3, for srt installments