定制 sroor/laravel-payment 二次开发

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

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

sroor/laravel-payment

最新稳定版本:v1.0.2

Composer 安装命令:

composer require sroor/laravel-payment

包简介

laravel payemnts getawaies

README 文档

README

This is a laravel package to facilate integartion with paymob apis Paymob docs.

Installation

1- You can install the package via composer:

composer require sroor/laravel-payment

2- Publish config file for editing if needed:

php artisan vendor:publish --tag=config --provider="Sroor\Payment\PaymentServiceProvider"

Usage

  • Register new merchant account or login if you already have one (Register).
  • Get Paymob credentials from Paymob Dashboard (How) and update .env file.
PAYMENT_PAYMOB_API_KEY             =
PAYMENT_PAYMOB_CARD_INTEGRATION_ID =
PAYMENT_PAYMOB_CARD_IFRAME_ID      =
PAYMENT_PAYMOB_HMAC_SECRET         =
  • Make payment and get iframe url from paymob
<?php

use Illuminate\Support\Facades\Route;
use Sroor\Payment\Facades\Paymob;


Route::get('/test', function () {

    $orderData = [
        "amount_cents"=> "100", // required, integer value in cents
        "currency"=> "EGP", // required
        "merchant_order_id"=> 1243, //	optional, A unique alpha-numeric value for each transaction
        "expiration" => 3600, // required
        // optional fields in billing data, if it isn't available, please send it to be "NA",
        "billing_data" => [
            "first_name" => "Kamal", // required
            "last_name" => "Sroor", // required
            "email" => "Kamal@mail.com", // required
            "phone_number" => "01234567890", // required 
            "apartment" => "NA", // optional
            "floor" => "NA", // optional
            "street" => "NA", //optional
            "building" => "NA",  // optional
            "shipping_method" => "NA", // optional
            "postal_code" => "NA",  //optional
            "city" => "NA",  // optional
            "country" => "NA", // optional
            "state" => "NA" // optional
        ],
    ];

    // Get payment iframe URL
    $iframeUrl = Paymob::pay($orderData);
    return $iframeUrl;
    //redirect to ifram url
    // return redirect()->to($iframeUrl);
});
  • Webhook transaction url:

    POST Request: (https://yourdomain.com/paymob/webhook)

    Replace your yourdomain.com with actual domain name

    For testing callback, you can use tool like Ngrok

  • Add Paymob trasaction callback to integration card How

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-06-19