ehcan/myket_validation

A simple npm module for validate https://myket.ir/ payments

1.0.0 2020-12-01 19:30 UTC

This package is auto-updated.

Last update: 2021-10-22 16:12:07 UTC


README

A simple composer package for validate https://myket.ir/ payments

Installation

Installation is done using the

$ composer require ehcan/myket_validation

Usage Example

<?php
use \MyketValidator\Validator;

class SomeClass extends SomeInterface {
  public function someMethod(){
    $myket = new Validator($packageName, $token);
    $paymentResult = $myket->validate($sku, $payment_token);

    if($paymentResult['status'] === 200 && $paymentResult['data']['purchaseState'] === 0){
      // success
      // your logic
    }
    else{
      // failed
      // your logic here
    }

  }

}