当前位置: 首页 > 知识库问答 >
问题:

如何在realex/global pay中将自动结算标志设置为MULTI?

赵鸿畴
2023-03-14

我已经通过他们的留档,它说要设置自动定居标志为多。但是在PHP SDK库中没有这样的参数。

从他们的文件中

如何在HPP中将自动结算标志设置为多个?

我还添加了下面的代码示例:

require_once('vendor/autoload.php');

use GlobalPayments\Api\Entities\Address;
use GlobalPayments\Api\Entities\Enums\AddressType;
use GlobalPayments\Api\ServicesConfig;
use GlobalPayments\Api\HostedPaymentConfig;
use GlobalPayments\Api\Entities\HostedPaymentData;
use GlobalPayments\Api\Entities\Enums\HppVersion;
use GlobalPayments\Api\Entities\Exceptions\ApiException;
use GlobalPayments\Api\Services\HostedService;

// configure client, request and HPP settings
$config = new ServicesConfig();
$config->merchantId = "MerchantId";
$config->accountId = "internet";
$config->sharedSecret = "secret";
$config->serviceUrl = "https://pay.sandbox.realexpayments.com/pay";

$config->hostedPaymentConfig = new HostedPaymentConfig();
$config->hostedPaymentConfig->version = HppVersion::VERSION_2;
$service = new HostedService($config);

// Add 3D Secure 2 Mandatory and Recommended Fields
$hostedPaymentData = new HostedPaymentData();
$hostedPaymentData->customerEmail = "james.mason@example.com";
$hostedPaymentData->customerPhoneMobile = "44|07123456789";
$hostedPaymentData->addressesMatch = false;

$billingAddress = new Address();
$billingAddress->streetAddress1 = "Flat 123";
$billingAddress->streetAddress2 = "House 456";
$billingAddress->streetAddress3 = "Unit 4";
$billingAddress->city = "Halifax";
$billingAddress->postalCode = "W5 9HR";
$billingAddress->country = "826";

$shippingAddress = new Address();
$shippingAddress->streetAddress1 = "Apartment 825";
$shippingAddress->streetAddress2 = "Complex 741";
$shippingAddress->streetAddress3 = "House 963";
$shippingAddress->city = "Chicago";
$shippingAddress->state = "IL";
$shippingAddress->postalCode = "50001";
$shippingAddress->country = "840";

try {
   $hppJson = $service->authorize(19.99)
      ->withCurrency("EUR")
      ->withHostedPaymentData($hostedPaymentData)
      ->withAddress($billingAddress, AddressType::BILLING)
      ->withAddress($shippingAddress, AddressType::SHIPPING)
      ->serialize();      
   // TODO: pass the HPP JSON to the client-side    
} catch (ApiException $e) {
   // TODO: Add your error handling here
}

共有1个答案

养淇
2023-03-14

目前,环球支付公司PHP SDK似乎不支持多捕获。

https://github.com/globalpayments/php-sdk/blob/master/src/Gateways/RealexConnector.php#L163

但是,正在添加多捕获功能,并将在将来的某个时候提供。

在此之前,请随时更新回购协议的分支,以满足您的需要。我们在基本级别TransactionBuilder上添加了一个mutli capture boolen标志,并通过AuthorizationBuilder将该标志用于RealexConnector的processTransaction方法。然后我将检查标志,并将自动结算设置为“多”,如果未设置,则遵循0/1值的现有逻辑。

 类似资料:
  • 我不使用GUI编辑器手动创建布局,我需要将高度设置为“自动”,以便用户可以看到整个表单。我将GridLayout包装到FlowLayout中,这样输入就不会被拉伸。创建这样的布局的最佳实践是什么。是否有人可以修改它,使整个表单可见或使用GridLayout,但可以设置表单中输入的宽度和高度? 未使用包装方法设置首选尺寸 使用包装方法设置首选尺寸 将扩展状态设置为最大化,但更新按钮不完全可见。如何设

  • 问题内容: 如何使MySQL自动以4位数格式递增? 那么将“ 0001”代替“ 1”? 问题答案: 尝试将ZEROFILL属性添加到该字段。

  • 本文向大家介绍如何在JavaFX中将动作设置为RadioButton?,包括了如何在JavaFX中将动作设置为RadioButton?的使用技巧和注意事项,需要的朋友参考一下 单选按钮是一种圆形的按钮。它有两种状态,选择和取消选择。通常,单选按钮使用切换组进行分组,您只能在其中选择一个。 您可以通过实例化javafx.scene.control.RadioButton类(它是ToggleButto

  • 我目前正在学习Spring Hibernate的集成,到目前为止,我正在让它发挥作用。但我遇到了这样的情况:我不想在进程结束时提交事务,因为我只想看到生成的sql语句,以用于测试和调试。 我已经在我的hibernate属性中添加了false,但它仍然不起作用。 如果使用Spring处理hibernate事务,是否可能实现?因为在hibernate中使用传统事务是可能的,只是不调用会话。commit

  • 问题内容: 我最近开始在Node.js中工作,在app.js文件中有以下一行: 现在,如何设置自己的自定义favicon.ico? 问题答案: 在Express 4中 安装收藏夹中间件,然后执行以下操作: 或者更好,使用模块: (请注意,此解决方案也可以在Express 3应用中使用) 在Express 3中 根据API,接受一个location参数: 大多数时候,您可能希望这样做(如vsync建