GithubHelp home page GithubHelp logo

tpp-php-sdk's Introduction

TropiPay SDK PHP

TropiPay SDK for PHP.

Install

  • composer init
  • composer require tonykssa/tpp-sdk

Example

  • Create demo.php file:
// loading library
require_once __DIR__.'/vendor/autoload.php';
use TppSdk\TropiPay as TropiPay;

// define credentials
$clientId = "5aca1638f7596bee9cb388e51d2ad58e";
$clientSecret = "4a0150d3cec2036b9f24ec53f52e7c19";

// define the environment to use (production, development, test, etc.)
$enviroment = "develop";

// instantiate the library
$srv = new TropiPay($clientId, $clientSecret, $enviroment);

// define the data of the payment link to create
$payload = array(
    "reference"=> "my-paylink-1",
    "concept"=> "Bicycle",
    "favorite"=> "true",
    "amount"=> 3000,
    "currency"=>"EUR",
    "description" => "Two wheels",
    "singleUse"=>"true",
    "reasonId"=>4,
    "expirationDays"=>1,
    "lang"=>"es",
    "urlSuccess"=>"https://webhook.site/680826a5-199e-4455-babc-f47b7f26ee7e",
    "urlFailed"=>"https://webhook.site/680826a5-199e-4455-babc-f47b7f26ee7e",
    "urlNotification"=>"https://webhook.site/680826a5-199e-4455-babc-f47b7f26ee7e",
    "serviceDate"=>"2021-08-20",
    "client"=> array(
        "name"=>"John",
        "lastName"=>"McClane",
        "address"=>"Ave. Guadí 232, Barcelona, Barcelona",
        "phone"=>"+34645553333",
        "email"=>"[email protected]",
        "countryId"=>1,
        "termsAndConditions"=>"true"
    ),
    "directPayment"=>"true"
);

// create payment link
$paylink = $srv->createPaylink($payload);
  • php demo.php

tpp-php-sdk's People

Contributors

ameksike avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.