承接 mramitict/coinpayment 相关项目开发

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

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

mramitict/coinpayment

Composer 安装命令:

composer require mramitict/coinpayment

包简介

Coinpayments for Laravel

README 文档

README

Implementation of most of the CoinPayments functionality.

Coinpayments Website

1. Install Service Provider

// add directly from the app 
$app->register(\Mramitict\LaravelCoinpayments\Providers\LaravelCoinpaymentsServiceProvider::class);

OR

All service providers are registered in the config/app.php configuration file.

'providers' => [
    // Other Service Providers

    \Mramitict\LaravelCoinpayments\Providers\LaravelCoinpaymentsServiceProvider::class,
],

2. Configure

.env configuration

COINPAYMENTS_DB_PREFIX=cp_
COINPAYMENTS_MERCHANT_ID=your_unique_merchant_id
COINPAYMENTS_PUBLIC_KEY=generated_public_key
COINPAYMENTS_PRIVATE_KEY=generated_private_key
COINPAYMENTS_IPN_SECRET=your_custom_ipn_secret
COINPAYMENTS_IPN_URL=your_ipn_url
COINPAYMENTS_API_FORMAT=json

Execute php artisan vendor:publish for the complete config file.

Config: coinpayments.php

return array(

    // prefix to each of the tables in the database
    'database_prefix' => env('COINPAYMENTS_DB_PREFIX', 'cp_'),

    'merchant_id' => env('COINPAYMENTS_MERCHANT_ID'),

    // Your API public key associated with your coinpayments account
    'public_key' => env('COINPAYMENTS_PUBLIC_KEY'),

    // Your API private key associated with your coinpayments account
    'private_key' => env('COINPAYMENTS_PRIVATE_KEY'),

    // This is used to verify that an IPN is from us, use a good random string nobody can guess.
    'ipn_secret' => env('COINPAYMENTS_IPN_SECRET'),

    // URL for your IPN callbacks. If not set it will use the IPN URL in your Edit Settings page if you have one set.
    'ipn_url' => env('COINPAYMENTS_IPN_URL'),

    // The format of response to return, json or xml. (default: json)
    'format' => env('COINPAYMENTS_API_FORMAT', 'json'),

    // ALL logs all requests, ERROR logs only errors, and NONE never
    'log_level' => Log::LEVEL_ERROR,
);

3. Setup Database

Run the migration to install the database tables

php artisan migrate

4. Usage

Simple transaction

\Coinpayments::createTransactionSimple($cost, $currency_base, $currency_received, $extra_details);

IPN validation

try {
    \Coinpayments::validateIPNRequest($request);
    
    // do soemthing with the completed transaction
} catch (\Exception $e) {
    
    // transaction not completed.
}

5. Logging

Adjust the logging in the config file by selecting either LEVEL_NONE, LEVEL_ERROR or LEVEL_ALL.

Logs will be saved into the database under $prefix . 'log'.

Contributing

Feel free to make a pull request at any time. Any help is appreciated (Y)

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-03-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固