授权.net Java SDK 1.8.6并发,不工作?
Java SDK 1.8.6的Authorize.net示例代码 //为所有请求设置的通用代码授权.net Java SDK 1.8.6并发,不工作?,java,authorize.net,Java,Authorize.net,Java SDK 1.8.6的Authorize.net示例代码 //为所有请求设置的通用代码 ApiOperationBase.setEnvironment(Environment.SANDBOX); MerchantAuthenticationType merchantAuthenticationType = new MerchantAuthenticationType() ; merchantAuthenticationType.setName(“YOUR_API_LOGIN_ID
ApiOperationBase.setEnvironment(Environment.SANDBOX);
MerchantAuthenticationType merchantAuthenticationType = new MerchantAuthenticationType() ;
merchantAuthenticationType.setName(“YOUR_API_LOGIN_ID”);
merchantAuthenticationType.setTransactionKey(“YOUR_TRANSACTION_KEY”);
ApiOperationBase.setMerchantAuthentication(merchantAuthenticationType);
它使用静态方法ApiOperationBase.setMerchantAuthentication。对于具有多个商户的平台,用户不能同时向不同的商户付款
对于SDK版本1.8.3
Merchant merchant = Merchant.createMerchant(Environment.SANDBOX, apiLoginId, transactionKey);
它适用于并发性
有人能解释一下并发情况下1.8.6的API吗?谢谢。通过浏览源代码,看起来这仍然是可能的。您只需要使用其他方法,而不是对
ApiOperationsBase
执行静态操作
对于环境,调用controller.execute(environment)
而不是controller.execute()
对于商户身份验证,请调用apirest.setMerchantAuthentication(merchantAuthenticationType)
确切地说,我还没有对此进行测试,但我非常确定这是可行的。从源代码看,这似乎仍然是可能的。您只需要使用其他方法,而不是对
ApiOperationsBase
执行静态操作
对于环境,调用controller.execute(environment)
而不是controller.execute()
对于商户身份验证,请调用apirest.setMerchantAuthentication(merchantAuthenticationType)
确切地说,我还没有测试过,但我很确定这是可行的