Skip to content

federicoalbanese/paystar-task

Repository files navigation

Paystar - Task

Run Locally

Clone the project

  git clone https://github.com/federicoalbanese/paystar-task

Go to the project directory

  cd paystar-task

Install dependencies

  composer install
  npm install

Start the server

  php artisan serv
  npm run dev

Usage/Examples

Purchase/Pay

$invoice = new App\Services\IPG\DTOs\Invoice();
$invoice->setAmount($amount);

$payStar = new \App\Services\PaystarIpgService();

$payStar
->invoice($invoice)
->purchase(function($refId){
    // use $refId to save in database.
})
->pay();

Verify Payment

$gatewayResponse = new \App\Services\IPG\DTOs\GatewayResponse($request->all());

$invoiceDto = new InvoiceDto();
$invoiceDto->setAmount($amount);

$payStar = new \App\Services\PaystarIpgService();

$payStar
->invoice($invoice)
->verify($gatewayResponse);

Authors

About

Paystar company task ( implemented IPG)

Resources

Stars

Watchers

Forks

Languages