nofrixion/moneymoov-php
最新稳定版本:v3.0.1
Composer 安装命令:
composer require nofrixion/moneymoov-php
包简介
NoFrixion MoneyMoov PHP Library
README 文档
README
NoFrixion MoneyMoov PHP client library.
The latest library updates have been released as version 3.0.0 of the library. New models and clients/client methods have been added to support additional MoneyMoov API endpoints.
- Continue using
v1.x.xof this library if usingv1.x.xof either the NoFrixionwoocommerce-pluginor themagento2-payments-module. - Continue using
v2.0.0of this library if usingv2.0.0of the NoFrixionmagento2-payments-module.
Installation
To use the library in your project, run:
composer require nofrixion/moneymoov-php
Usage
The following example code shows how to use the library to create, update and delete payment requests (see the NoFrixion API documentation for a full MoneyMoov API reference and instructions on signing up for a sandbox account).
// Client for handling Payment Request API endpoints use Nofrixion\Client\PaymentRequestClient; // Models for creating/updating Payment Requests use Nofrixion\Model\PaymentRequests\PaymentRequestCreate; use Nofrixion\Model\PaymentRequests\PaymentRequestUpdate; // Model returned by payment request client on creation/update use Nofrixion\Model\PaymentRequests\PaymentRequest; use Nofrixion\Util\PreciseNumber; $apiUrl = "https://api-sandbox.nofrixion.com/"; // A merchant token can be used for creating and modifying payment requests - this MUST be securely stored. $token = getenv("MERCHANT_TOKEN_SANDBOX"); $client = new PaymentRequestClient($apiUrl, $token); // Creating a Payment request (payment amount is required). $amount = new PreciseNumber("1.11"); $newPaymentRequest = new PaymentRequestCreate($amount->__toString()); // Additional optional fields can be set directly on PaymentRequestCreate model. $newPaymentRequest->shippingFirstName = "Customer"; $newPaymentRequest->shippingLastName = "Name"; $newPaymentRequest->baseOriginUrl = "https://store.example.com"; // A PaymentRequest model is returned $result = $client->createPaymentRequest($newPaymentRequest); // UPDATES: use the PaymentRequestUpdate model to update payment request values. $update = new PaymentRequestUpdate(); $update->paymentMethodTypes = 'card, pisp'; $update->amount = "1.45"; $update->shippingAddressCity = "Dublin"; $result = $client->updatePaymentRequest($result->id, $update); // DELETING a payment request $deleted = $client->deletePaymentRequest($result->id);
统计信息
- 总下载量: 370
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-11-10