Simple laravel package for 2C2P Payment Gateway.

Related tags

Miscellaneous 2c2p
Overview

Laravel 2C2P Payment Gateway

Latest Version on Packagist Total Downloads License

Simple laravel package for 2C2P Payment Gateway.

Installation

You can install the package via composer:

composer require laraditz/2c2p

Available Methods

Below are all methods available under this package.

Method name Description
createPayment() Create a new payment and get payment URL.

Usage

You can use service container or facade.

// Using service container
app('Twoc2p')->createPayment($data);

// Using facade
\Twoc2p::createPayment($data);

Create Payment

To create payment and get the payment URL to be redirected to.

Parameter Type Description
invoiceNo string Unique invoice Number
description string Description of the payment
amount decimal The amount of payment
frontendReturnUrl string Redirect to this URL once payment complete

Example as below:

app('Twoc2p')->createPayment([
    'invoiceNo' => '1523953661',   
    'description' => 'item 1',
    'amount' => 100.00,
    'frontendReturnUrl' => 'http://domain.test/your-return-url',
]);

Return example:

array:2 [
  "id" => "94a19a34-965a-4e11-acd2-7acb02696f18"
  "payment_url" => "https://sandbox-pgw-ui.2c2p.com/payment/4.1/#/token/kSAops9Zwhos8hSTSeLTUxxx"
]

Redirect to the payment_url to proceed to 2C2P payment page. Once done, you will be redirected to the frontendReturnUrl. Below is the sample response returned.

{
	"invoiceNo": "280520075921",
	"channelCode": "CC",
	"respCode": "2000",
	"respDesc": "Transaction is completed, please do payment inquiry request for full payment information."
}

Event

This package also provide some events to allow your application to listen to it. You can create your listener and register it under event below.

Event Description
Laraditz\Twoc2p\Events\BackendReceived Received backend response from 2C2P for a payment. Can use to update your payment status and other details

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

You might also like...
Provides Bitcoin-Lightning payment gateway powered by Strike
Provides Bitcoin-Lightning payment gateway powered by Strike

Bitcoin Payments - Powered by Strike Drupal module to allow user to pay with bitcoin on your Commerce website using Strike API. Strike Js is used for

ShurjoPay payment gateway integration for PHP applications.

ShurjoPay PHP Library Using this library you can integrate ShurjoPay payment gateway into your PHP applications. If you face any problem then create i

MOKA > Opencart 2.3 Payment Gateway
MOKA Opencart 2.3 Payment Gateway

Moka - Opencart Payment Gateway Requirements PHP 5.6.0 and later. Dependencies The bindings require the following extensions in order to work properly

software development kit for purwantara.id payment gateway
software development kit for purwantara.id payment gateway

PURWANTARA LARAVEL ✨ What is Purwantara? Purwantara is a digital payment service provider that helps businesses to accept digital payments with seamle

Xenon\LaravelBDSms is a sms gateway package for sending text message to Bangladeshi mobile numbers using several gateways like sslcommerz, greenweb, dianahost,metronet in Laravel framework

Xenon\LaravelBDSms is a sms gateway package for sending text message to Bangladeshi mobile numbers using several gateways for Laravel. You should use

PHP package to communicate with the CMI payment plateform in Morocco
PHP package to communicate with the CMI payment plateform in Morocco

CMI PHP Payment bindings CMI PHP PAYMENT is an open source PHP payment handling library. it provides an easier way to communicate with CMI PAYMENT PLA

一个支持在 Swoole 或其它非 Workerman 环境,开发 Gateway Worker 的组件。

Workerman Gateway SDK 一个支持在 Swoole 或其它非 Workerman 环境,开发 Gateway Worker 的组件。 支持用 Workerman Gateway 做网关,Swoole 编写业务代码。 安装 composer require yurunsoft/wor

This is Laravel Framework. Referral User Management System, Payment using Coinpayment.net. etc

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Lightweight abstraction layer for payment gateways
Lightweight abstraction layer for payment gateways

Slickpay is lightweight abstraction layer for payment gateways. Documentation Documentation for Slickpay can be found on official website. Licence The

Owner
null
The Laravel eCommerce ABA Payment Gateway module allows the admin to integrate the ABA payment gateway to the online store.

Introduction Bagisto ABA Payment Gateway. Requirements: Bagisto: v1.3.2. Installation with composer: Run the following command composer require bagist

Bagisto 3 May 31, 2022
With the help of the Laravel eCommerce CashU Payment Gateway, the admin can integrate the CashU payment method in the Bagisto store.

Introduction Bagisto CashU Payment add-on allow customers to pay for others using CashU payment gateway. Requirements: Bagisto: v1.3.2 Installation wi

Bagisto 2 Aug 22, 2022
The whmcs payment module for TigoPesa Payment Gateway.

whmcs-tigopesa INSTALLATION INSTRUCTIONS TIGOPESA WHMCS Please follow the instructions below to setup the whmcs-tigopesa gateway module. Download zipp

Medson Naftali 3 Dec 11, 2021
uPay(bangladesh) payment gateway integration package for laravel

uPay BD Payment Gateway Requirements PHP >=7.2 Laravel >= 6 Installation composer require codeboxr/upay vendor publish (config) php artisan vendor:pub

Codeboxr CodeHub 6 Sep 24, 2022
Laravel integration with paymob (accept) payment gateway

Paymob Laravel Package This is a laravel package to facilate integartion with paymob apis Paymob docs. Installation 1- You can install the package via

Mohamed Sakr 6 Jun 7, 2023
A framework agnostic, multi-gateway payment processing library for PHP 5.6+

Omnipay An easy to use, consistent payment processing library for PHP Omnipay is a payment processing library for PHP. It has been designed based on i

The League of Extraordinary Packages 5.7k Dec 30, 2022
WHMCS Payment Gateway Module for Coinify

vrcoinify WHMCS Payment Gateway Module for Coinify Installing guide You should copy all contents from module folder to your WHMCS application folder u

VR DEV TEAM 3 Mar 15, 2022
A site to sell an E-book with paystack payment gateway integrated

YoungAndGetRich This is a platform to sell the named book using paystack payment gateway. Technology used are: MySql database PHP HTML5 CSS3 Bootstrap

Abiodun Sam 1 Oct 26, 2021
A payment gateway plugin for WooCommerce to see if your checkout works.

=== Order Test For All for WooCommerce === Contributors: ikamal Donate link: https://kamal.pw/ Tags: wc order test, wc order, woocommerce, woocommerce

Kamal 3 Dec 7, 2021
Integrate Paytm Payment gateway to php website.

paytm-integration-kit-project-for-PHP Integrate Paytm Payment gateway to php website. Copy PaytmKit folder in document root of your server (like /var/

Er. Dipankar Mohanta 1 Feb 11, 2022