定制 amirreza/omnipay-azki-vam 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

amirreza/omnipay-azki-vam

最新稳定版本:v1.1.0

Composer 安装命令:

composer require amirreza/omnipay-azki-vam

包简介

README 文档

README

composer require amirreza/omnipay-azki-vam

Example

Purchase

The result will be a redirect to the gateway or bank.

    $this->gateway = new Gateway(
            new Client(new \Http\Adapter\Guzzle7\Client()),
    );
    $amount = 60;
    $customerPhone = '09xxxxxxxxx';
    $items = [
        [
            "name" => "کالای شماره 1",
            "count" => 6,
            "amount" => 10,
            "url" => "https://merchant-website/items/1",
        ]
    ];

    /** @var CreateTicketResponse $response */
    $response = $this->gateway->purchase([
        'subUrl' => '/payment/purchase',
        'amount' => $amount,
        'customerPhone' => $customerPhone,
        'items' => $items,
    ])->send();
    if ($response->isSuccessful() && $response->isRedirect()) {
    // store the transaction reference to use in completePurchase()
    $transactionReference = $response->getTransactionReference();
    // Redirect to offsite payment gateway
    $response->redirect();
    } else {
        // Payment failed: display message to customer
        echo $response->getMessage();
    }

Complete Purchase (Verify)

// Send purchase complete request
    $param= [
        'subUrl' => '/payment/verify',
        'ticketId' => 'PJQPHFwN1AM6EUAJ',
    ];
    $response = $this->gateway->completePurchase($param)->send();
    
    if (!$response->isSuccessful() || $response->isCancelled()) {
        // Payment failed: display message to customer
        echo $response->getMessage();
    } else {
        // Payment was successful
        print_r($response);
    }

Refund Order

Refund an order by the $refNum:

    $param= [
        'subUrl' => '/payment/reverse',
        'ticketId' => 'PJQPHFwN1AM6EUAJ',
    ];
    /** @var ReverseTicketResponse $response */
    $response = $this->gateway->refund($param)->send();
    
    if ($response->isSuccessful()) {
        // Refund was successful
        print_r($response);
    } else {
        // Refund failed
        echo $response->getMessage();
    }

统计信息

  • 总下载量: 6
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-01-27