troopers/mangopay-bundle

此扩展包包含Mangopay PHP SDK作为服务

安装量: 17,813

依赖项: 0

建议者: 0

安全: 0

星级: 27

关注者: 13

分支: 19

开放性问题: 4

类型:symfony-bundle

3.0.5 2019-05-14 09:28 UTC

README

Troopers

Gitter License Version Packagist DL SensioLabsInsight Twitter Follow

MangopayBundle

描述

此扩展包提供官方SDK PHP for Mangopay api V2集成到Symfony。

配置

troopers_mangopay:
    client_id: your_mangopay_client_id
    client_password: your_mangopay_client_password
    base_url: your_mangopay_base_url

如何使用它?

官方SDK提供了一个"MangoMapApi"类,它是一个访问所有"工具"(如"ApiPayIns"、"ApiWallets"、"ApiUsers"等)的快捷方式。您可以通过服务"troopers_mangopay.mango_api"访问这些"工具"。

    $payIn = new PayIn();
    $this->get('troopers_mangopay.mango_api')->PayIns->create($payIn);

辅助工具

此外,还有一些辅助工具可以处理大多数Mangopay操作。欢迎您分叉并实现自己的。

BankInformationHelper

它可以注册用户银行信息,因为它实现了BankInformationInterface。

    $bankInformation = new BankInformation();
    $this->get('troopers_mangopay.bank_information_helper')->createBankAccount($bankInformation);

PaymentHelper

它可以注册卡预授权并执行它。

    $cardRegistration = new CardRegistration();
    $this->get('troopers_mangopay.payment_helper')->createPreAuthorisation($cardRegistration);

    $cardPreAuthorisation = new CardPreAuthorisation();
    $this->get('troopers_mangopay.payment_helper')->executePreAuthorisation($cardPreAuthorisation, $user, $wallet);

PaymentDirectHelper

它可以创建一个新的直接支付。

    $transaction = new Transaction();
    $this->get('troopers_mangopay.payment_direct_helper')->createDirectTransaction($transaction);

UserHelper

它可以创建一个新的Mangopay用户,因为用户对象实现了UserInterface。

    $user = new User();
    $this->get('troopers_mangopay.user_helper')->createMangoUser($user);

WalletHelper

它可以创建一个用户钱包。

    $user = new User();
    $this->get('troopers_mangopay.wallet_helper')->createWalletForUser($user);

一般工作流程

这是Mangopay支付页面的通用工作流程。

  1. 向用户显示支付表单

Step 1

  1. 通过Mangopay API创建Mangopay用户和卡注册

Step 2

  1. 调用令牌化服务器以验证用户的信用卡,如果需要,则使用3D Secure,更新带有令牌化卡的卡注册,创建预授权,然后将用户重定向到成功页面。 Step 3