shetabit / payment

simple laravel payment package , supports multiple drivers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Terminal is not active, please contact our support team.

rezasaberi opened this issue · comments

I have started developing a payment module for my application using Zarinpal driver explained at https://github.com/shetabit/payment/blob/HEAD/README-FA.md. However, when I call my function which is shown below, I get this error:
Shetabit\Multipay\Exceptions\PurchaseFailedException: Terminal is not active, please contact our support team. in file C:\xampp\htdocs\MyProject\vendor\shetabit\multipay\src\Drivers\Zarinpal\Strategies\Normal.php on line 104

This is what I have tried:

<?php

namespace App\Http\Controllers;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Shetabit\Multipay\Invoice;
use Shetabit\Payment\Facade\Payment;
use Auth;

class PaymentController extends Controller
{
    public function pay(Request $request){
        //dd($request->all());
        // Create new invoice.
        $invoice = new Invoice;
        
        // Set invoice amount.
        $invoice->amount($request->amount);

        $new_payment = \App\Models\Payment::create([
            'user_id' => Auth::id(),
            'item_id' => $request->item_id,
            'price' => $request->amount
        ]);

        // Do all things together in a single line.
        Payment::purchase(
            $invoice, 
            function($driver, $transactionId) {
                //I will save the transaction id to database
            }
        )->pay()->render();
    }
}