whapplepaysdk/whapplepay 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

whapplepaysdk/whapplepay

Composer 安装命令:

composer require whapplepaysdk/whapplepay

包简介

Empower your platform to seamlessly accept Whapple Pay payments with the Whapple Pay SDK. This comprehensive software development kit offers developers a robust solution for integrating Whapple Pay payment capabilities into their applications, ensuring a smooth and secure payment experience for user

README 文档

README

WhapplePay SDK Documentation

Introduction

Welcome to the WhapplePay SDK documentation. This SDK allows seamless integration with the WhapplePay payment gateway, enabling developers to process payments and withdrawals in their applications.

Installation

To use the WhapplePay SDK in your project, follow these steps:

  1. Install the SDK package using Composer:
    composer require vendor/whapplepay-sdk:^1.0.0
    
  2. Include the SDK in your PHP files:
    use Whapplepay\WhapplePaySDK;

Configuration

Before using the WhapplePay SDK, make sure to set the following environment variables in your .env file:

Base URl = http://whapplepay.com/api/sdkprocess-payment/payments

WHAPPLEPAY_API_URL=https://api.whapplepay.com/
WHAPPLEPAY_PAYMENT_METHOD=MobileMoney
WHAPPLEPAY_SUCCESS_URL=http://example.com/success
WHAPPLEPAY_CANCEL_URL=http://example.com/cancel
WHAPPLEPAY_CLIENT_ID=your_whapplepay_client_id
WHAPPLEPAY_CLIENT_SECRET=your_whapplepay_client_secret
CURRENCY=XAF

Usage

Initialization

Instantiate the WhapplePaySDK class to begin using the SDK:

$whapplePay = new WhapplePaySDK();
Process Payment

To process a payment using the WhapplePay SDK, use the processPayment method:

// Process Payment and Handle Response
$response = $whapplePay->processPayment($amount, $currency, $paymentMethod, $clientId, $clientSecret, $phoneNumber);

// Check if the payment was successful
if (isset($response['transaction']) && isset($response['status']) && $response['status'] == 200) {
    $transaction = $response['transaction'];
    
    // Display payment details
    echo "Payment Details:\n";
    echo "Transaction ID: " . $transaction['id'] . "\n";
    echo "Amount: " . $transaction['total'] . " " . $transaction['currency'] . "\n";
    echo "Status: " . $transaction['status'] . "\n";

    // Additional processing or actions based on the payment success
    // For example, update user balance, send confirmation email, etc.
    // Your code here...

    // Display success message
    echo "Payment successful!\n";
} else {
    // Handle payment failure or other errors
    if (isset($response['error'])) {
        echo "Error: " . $response['error'] . "\n";
    } else {
        echo "Payment failed!\n";
    }
}

Parameters:

  • $amount: The amount of the payment.
  • $currency: The currency of the payment (e.g., "F.CFA", "NGN").
  • $paymentMethod: The payment method (e.g., "WhapplpePay", "MobileMoney").
  • $clientId: Your client ID for authentication.
  • $clientSecret: Your client secret for authentication.
  • $phoneNumber: The phone number for MobileMoney payments.
Withdraw Money

To initiate a withdrawal using the WhapplePay SDK, use the withdrawMoney method:

$response = $whapplePay->withdrawMoney($amount, $currency, $withdrawMethod, $clientId, $clientSecret);

Parameters:

  • $amount: The amount to withdraw.
  • $currency: The currency of the withdrawal.
  • $withdrawMethod: The withdrawal method.
  • $clientId: Your client ID for authentication.
  • $clientSecret: Your client secret for authentication.

Supported Payment Methods

The following table shows the supported payment methods and their implementation status for both deposit and withdrawal:

Payment Method Deposit Implemented Withdraw Implemented
WhapplePay
MobileMoney
PayPal
Bank Transfer

Errors Handling

In case of any errors during API calls, the SDK returns an error message. Handle these errors appropriately in your application.

Versioning

The WhapplePay SDK follows semantic versioning. Ensure compatibility by specifying the desired version when installing the package.

Support and Feedback

For support or feedback regarding the WhapplePay SDK, contact our support team at support@whapplepay.com.

License

The WhapplePay SDK is licensed under the MIT License. Refer to the LICENSE file for details.

whapplepaysdk/whapplepay 适用场景与选型建议

whapplepaysdk/whapplepay 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 9 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 05 月 07 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 whapplepaysdk/whapplepay 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 whapplepaysdk/whapplepay 我们能提供哪些服务?
定制开发 / 二次开发

基于 whapplepaysdk/whapplepay 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-05-07