���Root Mod By V1rus_Alfa
User / IP
:
216.73.217.78
Host / Server
:
195.214.235.115 / npln.ir
System
:
Linux damavand.pws-dns.net 5.14.0-503.35.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Apr 4 05:23:43 EDT 2025 x86_64
Command
|
Upload
|
Mass Deface
|
Create
:
/
home2
/
cutunixc
/
repositories
/
npln
/
vendor
/
shetabit
/
multipay
/
src
/
Drivers
/
Gooyapay
/
Viewing: Gooyapay.php
<?php namespace Shetabit\Multipay\Drivers\Gooyapay; use GuzzleHttp\Client; use Shetabit\Multipay\Abstracts\Driver; use Shetabit\Multipay\Exceptions\InvalidPaymentException; use Shetabit\Multipay\Exceptions\PurchaseFailedException; use Shetabit\Multipay\Contracts\ReceiptInterface; use Shetabit\Multipay\Invoice; use Shetabit\Multipay\Receipt; use Shetabit\Multipay\RedirectionForm; use Shetabit\Multipay\Request; class Gooyapay extends Driver { /** * Gooyapay Client. * * @var object */ protected $client; /** * Invoice * * @var Invoice */ protected $invoice; /** * Driver settings * * @var object */ protected $settings; /** * Gooyapay constructor. * Construct the class with the relevant settings. * * @param Invoice $invoice * @param $settings */ public function __construct(Invoice $invoice, $settings) { $this->invoice($invoice); $this->settings = (object) $settings; $this->client = new Client(); } /** * Purchase Invoice. * * @return string * * @throws \GuzzleHttp\Exception\GuzzleException */ public function purchase() { $details = $this->invoice->getDetails(); $name = ''; if (!empty($details['name'])) { $name = $details['name']; } $mobile = ''; if (!empty($details['mobile'])) { $mobile = $details['mobile']; } elseif (!empty($details['phone'])) { $mobile = $details['phone']; } $email = ''; if (!empty($details['mail'])) { $email = $details['mail']; } elseif (!empty($details['email'])) { $email = $details['email']; } $desc = ''; if (!empty($details['desc'])) { $desc = $details['desc']; } elseif (!empty($details['description'])) { $desc = $details['description']; } $amount = $this->invoice->getAmount(); if ($this->settings->currency != 'T') { $amount /= 10; } $amount = intval(ceil($amount)); $orderId = crc32($this->invoice->getUuid()); if (!empty($details['orderId'])) { $orderId = $details['orderId']; } elseif (!empty($details['order_id'])) { $orderId = $details['order_id']; } $data = array( "MerchantID" => $this->settings->merchantId, "Amount" => $amount, "InvoiceID" => $orderId, "Description" => $desc, "FullName" => $name, "Email" => $email, "Mobile" => $mobile, "CallbackURL" => $this->settings->callbackUrl, ); $response = $this->client->request('POST', $this->settings->apiPurchaseUrl, ["json" => $data, "http_errors" => false]); $body = json_decode($response->getBody()->getContents(), false); if ($body->Status != 100) { // some error has happened throw new PurchaseFailedException($body->Message); } $this->invoice->transactionId($body->Authority); // return the transaction's id return $this->invoice->getTransactionId(); } /** * Pay the Invoice * * @return RedirectionForm */ public function pay() : RedirectionForm { $payUrl = $this->settings->apiPaymentUrl.$this->invoice->getTransactionId(); return $this->redirectWithForm($payUrl, [], 'GET'); } /** * Verify payment * * @return mixed|void * * @throws InvalidPaymentException * @throws \GuzzleHttp\Exception\GuzzleException */ public function verify() : ReceiptInterface { $PaymentStatus = Request::input('PaymentStatus'); if ($PaymentStatus != 'OK') { throw new InvalidPaymentException('تراکنش از سوی کاربر لغو شد', $PaymentStatus); } $Authority = Request::input('Authority'); $InvoiceID = Request::input('InvoiceID'); if ($Authority != $this->invoice->getTransactionId()) { throw new InvalidPaymentException('اطلاعات تراکنش دریافتی با صورتحساب همخوانی ندارد', 'DATAMISMATCH'); } $amount = $this->invoice->getAmount(); if ($this->settings->currency != 'T') { $amount /= 10; } $amount = intval(ceil($amount)); //start verfication $data = array( "MerchantID" => $this->settings->merchantId, "Authority" => $Authority, "Amount" => $amount, ); $response = $this->client->request('POST', $this->settings->apiVerificationUrl, ["json" => $data, "http_errors" => false]); $body = json_decode($response->getBody()->getContents(), false); if ($body->Status != 100) { throw new InvalidPaymentException($body->Message, $body->Status); } $receipt = new Receipt('gooyapay', $body->RefID); $receipt->detail([ 'Authority' => $data['Authority'], 'InvoiceID1' => $InvoiceID, 'InvoiceID2' => $body->InvoiceID, 'Amount1' => $data['Amount'], 'Amount2' => $body->Amount, 'CardNumber' => $body->MaskCardNumber, 'PaymentTime' => $body->PaymentTime, 'PaymenterIP' => $body->BuyerIP ]); return $receipt; } }
Coded With 💗 by
0x6ick Mod By V1rus_Alfa