承接 svodya/payzone 相关项目开发

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

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

svodya/payzone

Composer 安装命令:

composer require svodya/payzone

包简介

This package is payment integration for laravel7 users.

README 文档

README

Hey! I've made a library package for laravel6/7 users. This package can be useful for UK based companies.

This is a [takepayments] payment gateway which is not available from their website. So, I decided to make it as a library for laravel users. I'm trying to develope it under MIT license.

`composer require svodya/payzone`

All you need to store your data to cart Session('cart') or you can make checkout form as well. A post method need to be there action will be /process

Keys need to be set in your .env file

PAYZONE_MERCHANT_ID=xxxxxxxxxx
PAYZONE_MERCHANT_PASS=xxxxxxxx
PAYZONE_MERCHANT_KEY=xxxxxxxxxxxxxxxxxx
PAYZONE_DEFAULT_CURRENCY=$
PAYZONE_CURRENCY_CODE=123

Here is an example of checkout form:

This form use tailwind css classes to design.

You can fetch last order id from your database to generate a value for your order. Order id is autoincrement value in database.

Main form id="payzone-payment-form" name="payzone-payment-form" target="_self" method="POST" action="/process"

    <form id="payzone-payment-form" name="payzone-payment-form" target="_self" method="POST" action="/process">
        <div class="shadow overflow-hidden sm:rounded-md">
            <div class="px-4 py-5 bg-white sm:p-6">
                <div class="grid grid-cols-6 gap-6">
                    <div class="col-span-6 sm:col-span-6 lg:col-span-2">
                        <label for="OrderID" class="block text-sm font-medium text-gray-700">Order Id</label>
                        <input type="text" readonly name="OrderID" id="OrderID" value="{{ $order->id ?? '' }}" autocomplete="order-id" class="mt-1 text-gray-400 focus:ring-indigo-500 focus:border-indigo-500 block w-full shadow-sm sm:text-sm border-gray-300 rounded-md">
                    </div>
                    <div class="col-span-6 sm:col-span-6 lg:col-span-2">
                        <label for="Amount" class="block text-sm font-medium text-gray-700">Amount</label>
                        <input type="text" readonly id="Amount" value="{{ $order->total_price ?? '' }}" autocomplete="amount" class="mt-1 focus:ring-indigo-500 focus:border-indigo-500 block w-full shadow-sm sm:text-sm border-gray-300 rounded-md">
                    </div>
                    <div class="col-span-6 sm:col-span-6 lg:col-span-2">
                        <label for="OrderDescription" class="block text-sm font-medium text-gray-700">Description</label>
                        <input type="text" readonly name="OrderDescription" id="OrderDescription" value="{{ $order->order_details ?? 'Product was purchased' }}" autocomplete="order-description" class="mt-1 text-gray-400 focus:ring-indigo-500 focus:border-indigo-500 block w-full shadow-sm sm:text-sm border-gray-300 rounded-md">
                    </div>
                    <input type="hidden" name="Amount" id="Amount" value="{{ $order->order_price }}">
                    <input type="hidden" name="CurrencyCode" id="CurrencyCode" value="{{ config('payzone.currencyCode') }}">
                    <input type="hidden" name="TransactionDateTime" id="TransactionDateTime" value="{{ $order->created_at }}">
                    <input type="hidden" name="TransactionType" id="TransactionType" value="{{ config('payzone.transactionType') }}">
                </div>
            </div>
            <div class="px-4 py-5 bg-white sm:p-6">
                <div class="grid grid-cols-6 gap-6">
                    <div class="col-span-6 sm:col-span-6 lg:col-span-2">
                        <label for="CustomerName" class="block text-sm font-medium text-gray-700">Customer Name</label>
                        <input type="text" name="CustomerName" value="{{ old('CustomerName') ?? '' }}" id="CustomerName" autocomplete="customer-name" class="mt-1 focus:ring-indigo-500 focus:border-indigo-500 block w-full shadow-sm sm:text-sm border-gray-300 rounded-md" required>
                    </div>
                    <div class="col-span-6 sm:col-span-6 lg:col-span-2">
                        <label for="Address1" class="block text-sm font-medium text-gray-700">Address line1</label>
                        <input type="text" name="Address1" value="{{ old('Address1') ?? '' }}" autocomplete="Address1" class="mt-1 focus:ring-indigo-500 focus:border-indigo-500 block w-full shadow-sm sm:text-sm border-gray-300 rounded-md" required>
                    </div>
                    <div class="col-span-6 sm:col-span-6 lg:col-span-2">
                        <label for="Address2" class="block text-sm font-medium text-gray-700">Address line2</label>
                        <input type="text" name="Address2" id="Address2" value="{{ old('Address2') ?? '' }}" autocomplete="Address2" class="mt-1 focus:ring-indigo-500 focus:border-indigo-500 block w-full shadow-sm sm:text-sm border-gray-300 rounded-md">
                    </div>
                    <div class="col-span-6 sm:col-span-6 lg:col-span-2">
                        <label for="Address3" class="block text-sm font-medium text-gray-700">Address line3</label>
                        <input type="text" name="Address3" id="Address3" value="{{ old('Address3') ?? '' }}" autocomplete="Address3" class="mt-1 focus:ring-indigo-500 focus:border-indigo-500 block w-full shadow-sm sm:text-sm border-gray-300 rounded-md">
                    </div>
                    <div class="col-span-6 sm:col-span-6 lg:col-span-2">
                        <label for="Address4" class="block text-sm font-medium text-gray-700">Address line4</label>
                        <input type="text" name="Address4" id="Address4" value="{{ old('Address4') ?? '' }}" autocomplete="Address4" class="mt-1 focus:ring-indigo-500 focus:border-indigo-500 block w-full shadow-sm sm:text-sm border-gray-300 rounded-md">
                    </div>
                    <div class="col-span-6 sm:col-span-6 lg:col-span-2">
                        <label for="City" class="block text-sm font-medium text-gray-700">City</label>
                        <input type="text" name="City" id="City" value="{{ old('City') ?? '' }}" autocomplete="city" class="mt-1 focus:ring-indigo-500 focus:border-indigo-500 block w-full shadow-sm sm:text-sm border-gray-300 rounded-md" required>
                    </div>
                    <div class="col-span-6 sm:col-span-6 lg:col-span-2">
                        <label for="State" class="block text-sm font-medium text-gray-700">State</label>
                        <input type="text" name="State" value="{{ old('State') ?? '' }}" id="State" autocomplete="state" class="mt-1 focus:ring-indigo-500 focus:border-indigo-500 block w-full shadow-sm sm:text-sm border-gray-300 rounded-md" required>
                    </div>
                    <div class="col-span-6 sm:col-span-6 lg:col-span-2">
                        <label for="PostCode" class="block text-sm font-medium text-gray-700">PostCode</label>
                        <input type="text" name="PostCode" value="{{ old('PostCode') ?? '' }}" id="PostCode" autocomplete="postal-code" class="mt-1 focus:ring-indigo-500 focus:border-indigo-500 block w-full shadow-sm sm:text-sm border-gray-300 rounded-md" required>
                    </div>
                    <div class="col-span-6 sm:col-span-6 lg:col-span-2">
                        <label for="CountryCode" class="block text-sm font-medium text-gray-700">Country Code</label>
                        <input type="text" name="CountryCode" value="{{ old('CountryCode') ?? '' }}" id="CountryCode" autocomplete="country-code" class="mt-1 text-gray-400 focus:ring-indigo-500 focus:border-indigo-500 block w-full shadow-sm sm:text-sm border-gray-300 rounded-md" required>
                    </div>
                </div>
            </div>
            @if(config('payzone.integrationType') =='direct' || config('payzone.integrationType') =='transparent')
                <div class="px-4 py-5 bg-white sm:p-6">
                    <div class="grid grid-cols-6 gap-6">
                        <div class="col-span-6 sm:col-span-6 lg:col-span-2">
                            <label for="CardName" class="block text-sm font-medium text-gray-700">Card Holder Name</label>
                            <input type="text" name="CardName" value="{{ old('CardName') ?? '' }}" id="CardName" autocomplete="customer-name" class="mt-1 focus:ring-indigo-500 focus:border-indigo-500 block w-full shadow-sm sm:text-sm border-gray-300 rounded-md" required>
                        </div>
                        <div class="col-span-6 sm:col-span-6 lg:col-span-2">
                            <label for="CardNumber" class="block text-sm font-medium text-gray-700">Card Number</label>
                            <input type="text" name="CardNumber" id="CardNumber" value="{{ old('CardNumber') ?? '' }}" autocomplete="card-number" class="mt-1 focus:ring-indigo-500 focus:border-indigo-500 block w-full shadow-sm sm:text-sm border-gray-300 rounded-md" required>
                        </div>
                        <div class="col-span-6 sm:col-span-6 lg:col-span-2">
                            <label for="CV2" class="block text-sm font-medium text-gray-700">CV2</label>
                            <input type="text" name="CV2" id="CV2" value="{{ old('CV2') ?? '' }}" autocomplete="CV2" class="mt-1 focus:ring-indigo-500 focus:border-indigo-500 block w-full shadow-sm sm:text-sm border-gray-300 rounded-md" required>
                        </div>
                        <div class="col-span-6 sm:col-span-6 lg:col-span-2">
                            <label for="ExpiryDateMonth" class="block text-sm font-medium text-gray-700">Expiry Date Month</label>
                            <input type="text" name="ExpiryDateMonth" id="ExpiryDateMonth" value="{{ old('ExpiryDateMonth') ?? '' }}" autocomplete="Address3" class="mt-1 focus:ring-indigo-500 focus:border-indigo-500 block w-full shadow-sm sm:text-sm border-gray-300 rounded-md" required>
                        </div>
                        <div class="col-span-6 sm:col-span-6 lg:col-span-2">
                            <label for="ExpiryDateYear" class="block text-sm font-medium text-gray-700">Expiry Year</label>
                            <input type="text" name="ExpiryDateYear" id="ExpiryDateYear" value="{{ old('ExpiryDateYear') ?? '' }}" autocomplete="Address4" class="mt-1 focus:ring-indigo-500 focus:border-indigo-500 block w-full shadow-sm sm:text-sm border-gray-300 rounded-md" required>
                        </div>
                    </div>
                </div>
            @endif
            <div class="px-4 py-3 bg-gray-50 text-right sm:px-6">
                <button type="submit" class="inline-flex justify-center py-2 px-4 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
                    Submit
                </button>
            </div>
        </div>
    </form>

Publish your required files as follows:

To publish Configuration file

`php artisan vendor:publish --tag=config`

To publish Assets

`php artisan vendor:publish --tag=public --force`

Here is two sample card details provided by payzone or Take payments for test purpose.

Test card details:

{
  "test1": {
    "customername": "Geoff Wayne",
    "address1": "113 Broad Street West",
    "address2": "",
    "address3": "",
    "address4": "",
    "city": "Oldpine",
    "state": "Strongbarrow",
    "postcode": "SB42 1SX",
    "countrycode": "826",

    "cardname": "Geoff Wayne",
    "cardnumber": "4976350000006891",
    "cv2": "341",
    "expirydatemonth": "01",
    "expirydateyear": "25"
  },
  "test2": {
    "customername": "John watson",
    "address1": "32 Mulberry Street",
    "address2": "",
    "address3": "",
    "address4": "",
    "city": "East fort",
    "state": "Voiletdell",
    "postcode": "VL14 8PA",
    "countrycode": "826",

    "cardname": "John Watson",
    "cardnumber": "4976000000003436",
    "cv2": "452",
    "expirydatemonth": "01",
    "expirydateyear": "25"
  }
}

svodya/payzone 适用场景与选型建议

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

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

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

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-06-15