承接 inverseschool/omnipay-saman 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

inverseschool/omnipay-saman

最新稳定版本:v1.1.4

Composer 安装命令:

composer require inverseschool/omnipay-saman

包简介

README 文档

README

composer require inverseschool/omnipay-saman

Example

Purchase

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

    $gateway->setTerminalId('xxxxxxxxxxxx');
   
    $response = $gateway->purchase([
        'amount' => $amount,
        'transactionId' => 'Merchant-Ref-X',
        'returnUrl' => 'https://www.example.com/return',
    ])->send();

    // Process response
    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)

Verify an order by Transaction Reference:

    // Send purchase complete request
    
    $response = $gateway->completePurchase([
        'transactionReference' => $refNum,
    ])->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 Transaction Reference:

    $response = $gateway->refund([
        'transactionReference' => $refNum,
    ])->send();
    
    if ($response->isSuccessful()) {
        // Refund was successful
        print_r($response);
    } else {
        // Refund failed
        echo $response->getMessage();
    }

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-04-20