endpay/endpay-sdk

1.2.0 2021-05-02 04:14 UTC

This package is auto-updated.

Last update: 2024-04-29 04:47:10 UTC


README

Requirements

  • PHP >= 7.0

Install

Install package via composer

composer require endpay/endpay-sdk

Documentation

https://api-docs.endpay.cl

Usage

Instance and set configurations

use Endpay\Endpay;

$endpay = new Endpay();

$endpay->setCommerceId('commerceId');
$endpay->setApiKey('apiKey');

Create a payment

Documentation: https://api-docs.endpay.cl/#crear-un-pago

$payment = $endpay->payments()->create([
    'subject' => 'Prueba desde SDK PHP',
    'amount' => 1
]);

Read a payment

Documentation: https://api-docs.endpay.cl/#ver-un-pago

$paymentData = $endpay->payments()->read($payment['id']);