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

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

问题描述

我在应用程序中使用Authorize.net作为付款供应商.从Mobile 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控制器=新的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:

成绩:

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>

原始帖子可以在这里找到

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天全站免登陆