2017 © Pedro Peláez
 

library paysterify

image

paysterify/paysterify

  • Sunday, February 25, 2018
  • by cornex
  • Repository
  • 1 Watchers
  • 0 Stars
  • 6 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

paysterify

payment gateways for Laravel, (*1)

Example

$config = [
    // Required..
    'amount' => '2.50',
    'currency' => 'USD',

    // Optional..
    'sandbox' => true,
    'description' => 'hosting credits',

    // Depends on the gateway requirements..
    'client' => env('PAYPAL_CLIENT'),
    'secret' => env('PAYPAL_SECRET'),
    'url_return' => url('/paypal/return'),
    'url_cancel' => url('/paypal/cancel'),
];

use Illuminate\Http\Request;
use \Facades\Paysterify\Paysterify;

Route::get('/paypal', function () use ($config) {
    $paysterify = Paysterify::gateway('paysterify.paypal')->configure($config)->purchase();

    if ($paysterify->isRedirect()) {
        return $paysterify->redirect();
    }
});

Route::get('/paypal/return', function (Request $request) use ($config) {
    $paysterify = Paysterify::gateway('paysterify.paypal')->configure($config)->completePurchase([
        'paymentId' => $request->get('paymentId'),
        'payerId' => $request->get('PayerID'),
    ]);

    if ($paysterify->isCompleted()) {
        echo 'Thanks for your payment.';
    } else {
        echo 'Something went wrong, payment is not completed.';
    }
});

This is a very basic paypal example, you will be able to use the almost same code for multiple gateways with some minor tweaks., (*2)

The Versions

25/02 2018

dev-master

9999999-dev

  Sources   Download

The Requires

 

by eklundkristoffer

25/02 2018

0.1.0

0.1.0.0

  Sources   Download

The Requires

 

by eklundkristoffer