承接 mydevcodes/ipaymer-php 相关项目开发

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

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

mydevcodes/ipaymer-php

最新稳定版本:1.0.2

Composer 安装命令:

composer require mydevcodes/ipaymer-php

包简介

The official iPaymer PHP library

README 文档

README

[![Latest Version on Packagist](https://img.shields.io/packagist/v/mydevcodes/ ipaymer-php.svg?style=flat-square)](https://packagist.org/packages/mydevcodes/ ipaymer-php) [![Total Downloads](https://img.shields.io/packagist/dt/mydevcodes/ ipaymer-php.svg?style=flat-square)](https://packagist.org/packages/mydevcodes/ ipaymer-php)

Once you complete your iPaymer account there comes a time when you need to connect it to your application. This package is your best buddy when it comes to integrating iPaymer into your PHP Application. If your platform is not whitelisted by iPaymer you won't be able to use this library.

Installation

You can install the package via composer:

composer require mydevcodes/ipaymer-php

Usage

The simplest way to call iPaymer PHP:

use Mydevcodes\IpaymerPhp\IpaymerPhp;
IpaymerPhp::init('Your_Secret_Key', 'production|development');

Methods

Create a customer

Creating a customer also requires a subscription and a credit card to be attached.

$customerData = [
    'name' => 'Jimm',
    'email' => 'jimmy@jimmy.com'
];

$ipaymer_customer_id = IpaymerPhp::init('Your_Secret_Key')->create($customerData);

Redirection links

These helper methods will construct redirection links to iPaymer for different methods

New subscription / Upgrade to package

IpaymerPhp::init('Your_Secret_Key')->checkoutLink('CUSTOMER_IPAYMER_ID', 'PLAN_CODE', 'RETURN_URL');

New card

IpaymerPhp::init('Your_Secret_Key')->newCardLink('CUSTOMER_IPAYMER_ID');

Assign Plan

Assign a specific plan to a customer. This won't replace any of his previous active plans.

IpaymerPhp::init('Your_Secret_Key')->assign('CUSTOMER_IPAYMER_ID', 'PLAN_ID', 'QUANTITY');

Switch Plan

Replace a specific plan with another. Often used within upgrades/downgrades.

IpaymerPhp::init('Your_Secret_Key')->change('CUSTOMER_IPAYMER_ID', 'FROM_PLAN_ID', 'TO_PLAN_ID');

Payment Plans [DEPRACATED]

All your payment plans should be already registered in iPaymer. If a customer is defined only the plans attached to the same payment gateway will be returned.

IpaymerPhp::init('Your_Secret_Key')->plans($customerId);

Status

Returns customer status on each plan separately. If a customer has 2 plans it will return the status and extra information regarding those plans.

IpaymerPhp::init('Your_Secret_Key')->status('CUSTOMER_IPAYMER_ID');

Invoices

Returns all customer invoices in a descending order

IpaymerPhp::init('Your_Secret_Key')->invoices('CUSTOMER_IPAYMER_ID');

Generate custom invoice

use Mydevcodes\IpaymerPhp\IpaymerPhp;
IpaymerPhp::init('Your_Secret_Key')->generateInvoice('CUSTOMER_IPAYMER_ID', 'PLAN_CODE', 'PRICE', 'QUANTITY', 'DESCRIPTION');

Cancel Plan

Cancels a plan in customers billing cycle

IpaymerPhp::init('Your_Secret_Key')->cancel('CUSTOMER_IPAYMER_ID', 'PACKAGE_CODE');

Remove Card

Removes a card from a customer

IpaymerPhp::init('Your_Secret_Key')->remove('CUSTOMER_IPAYMER_ID', 'IPAYMER_CARD_ID');

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email tafa@thesocialplus.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-11-17