承接 wmsn-web/sdk-for-phonepe 相关项目开发

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

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

wmsn-web/sdk-for-phonepe

最新稳定版本:v1.0.0

Composer 安装命令:

composer require wmsn-web/sdk-for-phonepe

包简介

README 文档

README

A simple PHP package.

Installation

composer require wmsn-web/sdk-for-phonepe:^1.0

Usage

PhonePe PAY API

  • Creating a index.php
<?php
use WsmnWeb\SdkForPhonepe\PhonePe;

require __DIR__ . '/vendor/autoload.php';

$config = new PhonePe('PHONEPE_MERCHANTID','PHONEPE_SALTKEY',PHONEPE_SALTINDEX);//merchantId,SaltKey,SaltIndex after onboarding PhonePe Payment gateway you will got this.
$merchantTransactionId='MUID' . substr(uniqid(), -6);// Uqique Randoe transcation Id
$merchantOrderId='Order'.mt_rand(1000,99999);// orderId
$amount=100;// Amount in Paisa or amount*100
$redirectUrl="/success.php";// Redirect Url after Payment success or fail
$mode="PRODUCTION"; // MODE or PAYMENT UAT(test) or PRODUCTION(production)
$callbackUrl="/success.php";//Callback Url after Payment success or fail get response
$mobileNumber=9876543210;//Mobile No
$data=$config->PaymentCall("$merchantTransactionId","$merchantOrderId","$amount","$redirectUrl","$callbackUrl","$mobileNumber","$mode");// call function to get response form phonepe like url,msg,status
//header('Location:'. $data['url']);//use when you directly want to redirect to phonepe gateway
echo $data['url']; // here you get url after initiated PhonePe gateway

STATUS API

  • Create status.php
<?php
use WsmnWeb\SdkForPhonepe\PhonePe;

require __DIR__ . '/vendor/autoload.php';

$config = new PhonePe('PHONEPE_MERCHANTID','PHONEPE_SALTKEY',PHONEPE_SALTINDEX);

$check=$config->PaymentStatus('PHONEPE_MERCHANTID',$merchantTransactionId,$mode);
  if($check['status']=='SUCCESS' && $check['responseCode']==200) {
  return 'Payment Success';
}else{
return 'Payment Failed';
}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-03-16