2017 © Pedro Peláez
 

library recurring-payment

to create paypal recurring profile and to manage it

image

saurabh-bond/recurring-payment

to create paypal recurring profile and to manage it

  • Saturday, February 25, 2017
  • by saurabh_globussoft
  • Repository
  • 1 Watchers
  • 1 Stars
  • 32 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 28 % Grown

The README.md

SaurabhBond-RecurringPayment

To create paypal recurring profile, make transactions, and get the profile details, (*1)

Installation

in composer.json, write, (*2)

"saurabh-bond/recurring-payment": "dev-master"

and then update the composer, (*3)

add the location to psr-4 in your composer.json, (*4)

"SaurabhBond\\RecurringPayment\\":"vendor/saurabh-bond/recurring-payment/src"

Usages:

In your controller, add this line, (*5)

use SaurabhBond\RecurringPayment\PaymentController as Bond;

then in your function or method , create the Instance of PaymentController, (*6)

$paypalObj = Bond::createObject(); 

(1) to create recurring profile, (*7)

call createRecurringProfile() with params as below, (*8)

$description ====> Description of goods or services associated with the billing agreement. This field is required for each recurring payment billing agreement. For ex- Recurring Profile for Viralgram Package of $ 7, (*9)

$cancelUrl ====> (Required) URL to which the buyer is returned, if something went wrong., (*10)

$returnUrl ====> (Required) URL to which the buyer is returned, after successfully payment., (*11)

$ipnUrl ====> mention IPN url to which IPN response will be send, For recurring Payment IPN handling is must., (*12)

(2) to confirm payment, (*13)

In your success function ,call confirmPayment() with parmas as below, (*14)

$token ====> generated in first step, (*15)

$description ====> give the description same given for the createRecurringProfile(), (*16)

$amount ====> amount for what the recurring profiles is created., (*17)

$initialAmount ====> If you want to charge user at the very first time., (*18)

$billingPeriod ====> (Required) Unit for billing during this subscription period. Value is: Day/Week/SemiMonth/Month/Year, (*19)

$billingFrequency ====> (Required) Number of billing periods that make up one billing cycle., (*20)

for example,, (*21)

  $recurringProfileDetails = json_decode(Bond::getPaymentDetails($request['token'],$description,$amount,$billingPeriod,$billingFrequency), true);

  if ($recurringProfileDetails['status'] == 200) {  
    // store the profile details in database with the unique recurring profile id.
  } else {
    echo json_encode(['status' => 400, 'message' => $recurringProfileDetails['message']]);
  }

The Versions

25/02 2017

dev-master

9999999-dev

to create paypal recurring profile and to manage it

  Sources   Download

by sauabh kumar