2017 © Pedro Peláez
 

library pomelo-php

PHP Bindings for the Pomelo Pay API

image

sverraest/pomelo-php

PHP Bindings for the Pomelo Pay API

  • Tuesday, April 10, 2018
  • by simon@appfleet.uk
  • Repository
  • 1 Watchers
  • 2 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

PomeloPHP

Build Status codecov Scrutinizer Code Quality Maintainability Latest Stable Version License composer.lock, (*1)

PHP API Client and bindings for the Pomelo Pay API, (*2)

Using this PHP API Client you can interact with your Pomelo Pay: - 💳 Transactions, (*3)

Installation

Requires PHP 7.0 or higher, (*4)

The recommended way to install pomelo-php is through Composer:, (*5)

First, install Composer:, (*6)

$ curl -sS https://getcomposer.org/installer | php

Next, install the latest pomelo-php:, (*7)

$ php composer.phar require sverraest/pomelo-php

Finally, you need to require the library in your PHP application:, (*8)

require "vendor/autoload.php";

Development

  • Run composer test and composer phpcs before creating a PR to detect any obvious issues.
  • Please create issues for this specific API Binding under the issues section.
  • Contact Pomelo Pay directly for Pomelo Pay API support.

Quick Start

PomeloPHP\Client

First get your production or sandbox API key from Pomelo Pay., (*9)

If you want to get a production client:, (*10)

use PomeloPHP\Client;

$client = new Client('apikey', 'appid');

If you want to get a sandbox client:, (*11)

use PomeloPHP\Client;

$client = new Client('apikey', 'appid', 'sandbox');

If you want to pass additional GuzzleHTTP options:, (*12)

use PomeloPHP\Client;

$options = ['headers' => ['foo' => 'bar']];
$client = new Client('apikey', 'appid', 'sandbox', $options);

Available API Operations

The following exposed API operations from the Pomelo Pay API are available using the API Client., (*13)

See below for more details about each resource., (*14)

💳 Transactions, (*15)

Create a new transaction with or without a specific payment method., (*16)

Usage details

💳 Transactions

Create transaction with a specific payment method

use PomeloPHP\Client;

$client = new Client('apikey', 'appid');

$json = [
 "provider" => "alipay", // Payment method enabled for your merchant account such as bcmc, alipay, card
 "currency" => "GBP",
 "amount" => 1000, // 10.00 GBP
 "redirectUrl" => "https://foo.bar/order/123" // Optional redirect after payment completion
];

$transaction = $client->transactions->create($json);
header('Location: '. $transaction["url"]); // Go to transaction payment page

Create transaction without a payment method that will redirect to the payment method selection screen

use PomeloPHP\Client;

$client = new Client('apikey', 'appid');

$json = [
 "currency" => "GBP",
 "amount" => 1000, // 10.00 GBP
 "redirectUrl" => "https://foo.bar/order/987" // Optional redirect after payment completion
];

$transaction = $client->transactions->create($json);
header('Location: '. $transaction["url"]); // Go to payment method selection screen

About

➡️ You can follow me on 🐦 Twitter or ✉️ email me at simon[-at-]pomelopay.com., (*17)

⭐ Sign up as a merchant at https://pomelopay.com and start receiving payments in seconds., (*18)

The Versions

10/04 2018

dev-master

9999999-dev

PHP Bindings for the Pomelo Pay API

  Sources   Download

MIT

The Requires

 

The Development Requires

by Simon Verraest

api php pay pomelo pomelopay appfleet

08/04 2018

v1.0.0

1.0.0.0

PHP Bindings for the Pomelo Pay API

  Sources   Download

MIT

The Requires

 

The Development Requires

by Simon Verraest

api php pay pomelo pomelopay appfleet