承接 peach/oppwa 相关项目开发

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

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

peach/oppwa

最新稳定版本:1.0.0

Composer 安装命令:

composer require peach/oppwa

包简介

Peach Payments OPPWA php library

README 文档

README

Peach Payments OPPWA php library

Examples:

There is three ways to configure the client.

$config = new \Peach\Oppwa\Configuration(
    'set_your_user_id',
    'set_your_password',
    'set_your_entity_id'
);

$client = new \Peach\Oppwa\Client($config);
$client = new \Peach\Oppwa\Client([
    'set_your_user_id',
    'set_your_password',
    'set_your_entity_id']
);
$client = new \Peach\Oppwa\Client(
    'set_your_user_id',
    'set_your_password',
    'set_your_entity_id'
);

If you wish to use the test server.

    $client->setTestMode(true);

All responses will contain an isSuccess method to check if the result was successful

if ($response->isSuccess()) {
 // was successful
}

Getting a payment status.

$paymentStatus = new \Peach\Oppwa\Payments\Status($client);
$paymentStatusResult = $paymentStatus
    ->setTransactionId('8a82944a55c5c6620155ca4667222d20')
    ->process();

var_dump(json_decode((string)$paymentStatusResult, JSON_PRETTY_PRINT));

Storing a card.

$storeCard = new \Peach\Oppwa\Cards\Store($testClient);
$storeCardResult = $storeCard->setCardBrand(\Peach\Oppwa\Cards\Brands::MASTERCARD)
    ->setCardNumber('5454545454545454')
    ->setCardHolder('Jane Jones')
    ->setCardExpiryMonth('05')
    ->setCardExpiryYear('2018')
    ->setCardCvv('123')
    ->process();

Deleting a saved card.

$cardDelete = new \Peach\Oppwa\Cards\Delete($testClient);
$cardDelete->setTransactionId($storeCardResult->getId());
$cardDeleteResult = $cardDelete->process();

Doing a full debit.

$debit = new \Peach\Oppwa\Payments\Debit($testClient);
$debitResult = $debit
    ->setCardBrand(\Peach\Oppwa\Cards\Brands::MASTERCARD)
    ->setCardNumber('5454545454545454')
    ->setCardHolder('Jane Jones')
    ->setCardExpiryMonth('05')
    ->setCardExpiryYear('2018')
    ->setCardCvv('123')
    ->setAmount(95.99)
    ->setCurrency('EUR')
    ->setAuthOnly(false)
    ->process();

Doing a pre-auth only.

$preAuthorization = new \Peach\Oppwa\Payments\Debit($testClient);
$preAuthorizationResult = $preAuthorization
    ->setCardBrand(\Peach\Oppwa\Cards\Brands::MASTERCARD)
    ->setCardNumber('5454545454545454')
    ->setCardHolder('Jane Jones')
    ->setCardExpiryMonth('05')
    ->setCardExpiryYear('2018')
    ->setCardCvv('123')
    ->setAmount(95.99)
    ->setCurrency('EUR')
    ->setAuthOnly(true)
    ->process();

Doing a capture.

$capture = new \Peach\Oppwa\Payments\Capture($testClient, $preAuthorizationResult->getId(), '95.99', 'EUR');
$captureResult = $capture->process();

Doing a reversal (please note no value or currency provided).

$reverse = new \Peach\Oppwa\Payments\Reverse($testClient, $captureResult->getId());
$reverseResult = $reverse->process();

Doing a refund (please note I DID provide a value and currency)

$reverse = new \Peach\Oppwa\Payments\Reverse($testClient, $captureResult->getId(), '50', 'EUR');
$reverseResult = $reverse->process();

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: proprietary
  • 更新时间: 2016-07-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固