Skip to content
# PHP SDK for API and Webcheckout implementation
Branch: master
Clone or download
PaygolSPA Update Payer.php
(fix) added personalid param
Latest commit f1c654c Jul 2, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib/php-apiv2 Update Payer.php Jul 2, 2019
samples Added notification sample Jun 15, 2019
.gitignore updated sample files Jun 10, 2019
LICENSE initial commit Jun 10, 2019
README.md updated sample files Jun 10, 2019
composer.json initial commit Jun 10, 2019

README.md

PHP SDK for API and Webcheckout implementation

Installation

Requirements

PHP 5.6.4 and later.

Developer Documentation

Official Paygol Documentation

Composer

It's recommended to use composer or you can download the latest release.

composer require paygol/php-sdk

Example

require_once '../vendor/autoload.php';

$service_id = "123";
$shared_secret = "7c1a6a24-7943-102d-92f8-29573711ad31";

try {
    $pg = new \Paygol\API($service_id, $shared_secret);

    $redirectUrls = new \Paygol\Models\RedirectUrls();
    $redirectUrls->setRedirects(
      "https://www.my-site.com/success", 
      "https://www.my-site.com/failure"
    ); // optional

    $pg->setRedirects($redirectUrls);

    $pg->setCountry('DE');
    $pg->setPrice(10.00, 'EUR');
    $pg->setPaymentMethod('bitcoin');

    $payer = new \Paygol\Models\Payer();
    $payer->setFirstName('John');
    $payer->setLastName('Doe');
    $payer->setEmail('jdoe@my-site.com');
    $payer->setBIC('123423432');

    $pg->setPayer($payer);

    $payment = $pg->createPayment();

    var_dump( $payment );

    if (!empty($payment['data']['payment_method_url'])) {
        // do something
    }
} catch (\Exception $e) {
    die($e->getMessage());
}

License

Read License for more licensing information.

You can’t perform that action at this time.