Skip to content
This repository has been archived by the owner. It is now read-only.
No description, website, or topics provided.
PHP
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
tests
.editorconfig
.gitattributes
.gitignore
.travis.yml
LICENSE
README.md
composer.json
phpunit.xml.dist

README.md

MeteorPayment PHP Client

Build Status PHP from Packagist Latest Version License

https://gate2payments.docs.oppwa.com/

Installation

Require this package, with Composer, in the root directory of your project.

$ composer require plients/meteor-payment

Usage

SETUP THE METEOR PAYMENT CLIENT

$meteor = new Plients\MeteorPayment\MeteorPayment('METEOR_USER_ID', 'METEOR_PASSWORD', 'METEOR_ENTITY_ID');

PREPARE THE CHECKOUT

$customerDetails = [
    'givenName' => 'Cookie',
    'surname' => 'Monster',
    'email' => 'cookie@monst.er',
];

$billingDetails = [
    'city' => 'Sesame Town',
    'country' => 'AL',
    'state' => 'Cuki',
    'street1' => 'Sesamestreet',
    'postcode' => 66666,
];

$cartItems = [
    [
        'merchantItemId' => 1,
        'quantity' => 5,
        'name' => 'Product 1',
        'price' => 10.00,
        'tax' => 20.00,
    ], [
        'merchantItemId' => 2,
        'quantity' => 10,
        'name' => 'Product 1',
        'price' => 0.99,
        'tax' => 20.00,
    ],
];

$meteor->api('CopyAndPay')
       ->setPaymentType('DB')
       ->setCurrency('EUR')
       ->setAmount(10.00)
       ->setCustomer($customerDetails)
       ->setBillingAddress($billingDetails)
       ->setShippingAddress($billingDetails)
       ->setCart($cartItems)
       ->setCustomParameters(['key' => 'value'])
       ->checkout();
       // or ->checkoutWithRegistration() if we want to get a registrationId

CAPTURE AN AUTHORIZATION

$meteor->api('BackOffice')
       ->setCurrency('EUR')
       ->setAmount(10.00)
       ->capture('PAYMENT_ID');

REFUND A PAYMENT

$meteor->api('BackOffice')
       ->setCurrency('EUR')
       ->setAmount(10.00)
       ->refund('PAYMENT_ID');

REVERSE A PAYMENT

$meteor->api('BackOffice')
       ->reversal('PAYMENT_ID');

SENDING THE INITIAL PAYMENT

$creditCard = [
    'number' => '4200000000000000',
    'holder' => 'Jane Jones',
    'expiryMonth' => 05,
    'expiryYear' => 2018,
    'cvv' => 123,
];

$meteor->api('Recurring')
       ->setPaymentBrand('VISA')
       ->setPaymentType('PA')
       ->setCurrency('EUR')
       ->setAmount(10.00)
       ->setCreditCard($creditCard)
       ->initialize();

SENDING A REPEATED PAYMENT

$meteor->api('Recurring')
       ->setPaymentType('DB')
       ->setCurrency('EUR')
       ->setAmount(10.00)
       ->repeat('REGISTRATION_ID');

SEND AN ONE-CLICK PAYMENT

$meteor->api('OneClick')
       ->setPaymentType('DB')
       ->setCurrency('EUR')
       ->setAmount(10.00)
       ->charge('REGISTRATION_ID');

Available Setter-Methods

$meteor->api('CopyAndPay')->setFormParameter($key, $value); // Used internal by all set*-methods
$meteor->api('CopyAndPay')->unsetFormParameter($key);
$meteor->api('CopyAndPay')->setAmount($value);
$meteor->api('CopyAndPay')->setCurrency($value);
$meteor->api('CopyAndPay')->setPaymentBrand($value);
$meteor->api('CopyAndPay')->setPaymentType($value);
$meteor->api('CopyAndPay')->setDescriptor($value);
$meteor->api('CopyAndPay')->setMerchantTransactionId($value);
$meteor->api('CopyAndPay')->setMerchantInvoiceId($value);
$meteor->api('CopyAndPay')->setAuthentication($data);
$meteor->api('CopyAndPay')->setCreditCard($data);
$meteor->api('CopyAndPay')->setVirtualAccount($accountId, $password);
$meteor->api('CopyAndPay')->setBankAccount($data);
$meteor->api('CopyAndPay')->setCustomer($data);
$meteor->api('CopyAndPay')->setBillingAddress($data);
$meteor->api('CopyAndPay')->setShippingAddress($data);
$meteor->api('CopyAndPay')->setCart($items);
$meteor->api('CopyAndPay')->setCreateRegistration($value);
$meteor->api('CopyAndPay')->setRecurringType($value);
$meteor->api('CopyAndPay')->set3DSecure($data);
$meteor->api('CopyAndPay')->setCustomParameter($key, $value);
$meteor->api('CopyAndPay')->setCustomParameters($data);
$meteor->api('CopyAndPay')->setShopperResultUrl($value);
$meteor->api('CopyAndPay')->setNotificationUrl($value);
$meteor->api('CopyAndPay')->setTestMode($mode);

Testing

$ phpunit

Security

If you discover a security vulnerability within this package, please send an e-mail to hello@basecode.sh. All security vulnerabilities will be promptly addressed.

Credits

License

Mozilla Public License Version 2.0 (MPL-2.0).

You can’t perform that action at this time.