Authorize.net Java SDK(2.0.1v) 环境未设置问题 [英] Authorize.net Java SDK(2.0.1v) Environment not set issue

查看:24
本文介绍了Authorize.net Java SDK(2.0.1v) 环境未设置问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的应用程序中使用 Authorize.net 作为支付供应商.从移动 SDK 获取表单令牌后,我在后端使用他们的 Java SDK 来启动付款.

I am using Authorize.net as a Payment vendor in my application. After getting form token from Mobile SDK, I am using their Java SDK in Backend to initiate Payment.

但是我在使用 Authorize.net Java SDK(v2.0.1) 中的 CreateAnAcceptPaymentTransaction 类时遇到以下问题.

But I am getting the following issue while using CreateAnAcceptPaymentTransaction class from Authorize.net Java SDK(v2.0.1).

环境未设置.使用 setter 设置环境或使用重载传递适当环境的方法

下一行中的控制器对象有错误.

The controller object in the below line has the error.

CreateTransactionController controller = new CreateTransactionController(apiRequest);

我已经通过下面的一段代码设置了环境

I have already set the environment via the below piece of code

ApiOperationBase.setEnvironment(Environment.SANDBOX);

尝试将版本降级到 v2.0.0 但它对我不起作用.

Tried to downgrade the version to v2.0.0 but it doesn't worked for me.

任何帮助将不胜感激.

推荐答案

该错误实际上与设置环境无关.

The error was not actually with setting Environment.

您可能遇到了下面提到的例外情况.

You might have got an exception which is mentioned below.

javax.xml.bind.JAXBException Implementation of JAXB-API has not been found on module path or classpath 

缺少 gradle 文件或 Maven 文件中的依赖项.

It was with a missing dependency in gradle file or Maven file.

将这些依赖添加到你的 pom/gradle 中:

Add these dependencies into your pom/gradle:

Gradle:

compile('javax.xml.bind:jaxb-api:2.3.0')
compile('javax.activation:activation:1.1')
compile('org.glassfish.jaxb:jaxb-runtime:2.3.0')

Pom:

<!-- https://mvnrepository.com/artifact/javax.xml.bind/jaxb-api -->
<dependency>
    <groupId>javax.xml.bind</groupId>
    <artifactId>jaxb-api</artifactId>
    <version>2.3.0-b170201.1204</version>
</dependency>

<!-- https://mvnrepository.com/artifact/javax.activation/activation -->
<dependency>
    <groupId>javax.activation</groupId>
    <artifactId>activation</artifactId>
    <version>1.1</version>
</dependency>

<!-- https://mvnrepository.com/artifact/org.glassfish.jaxb/jaxb-runtime -->
<dependency>
    <groupId>org.glassfish.jaxb</groupId>
    <artifactId>jaxb-runtime</artifactId>
    <version>2.3.0-b170127.1453</version>
</dependency>

可以在此处找到原始帖子 javax.xml.bind.JAXBException 未在模块路径或类路径上找到 JAXB-API 的实现

Original Post can be found here javax.xml.bind.JAXBException Implementation of JAXB-API has not been found on module path or classpath

这篇关于Authorize.net Java SDK(2.0.1v) 环境未设置问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆