小编sid*_*sid的帖子

错误 :- {"code":"403", "message":"HMAC 验证失败"}

在这里我附上代码和一个包含完整代码的链接,看看它:-我的授权头接缝与payeezy官方网站中提到的长度相同。我也使我的hmacString具有与中提到的相同的顺序此链接(https://developer.payeezy.com/content/hmac-validation-failure)。做完这一切后,我仍然遇到同样的问题

public static String excutePost(String urlParameters) throws IOException {
        URL url = new URL("https://api-cert.payeezy.com/v1/transactions");
        HttpURLConnection connection = (HttpURLConnection) url.openConnection();
        try {
            // Create connection
            connection.setRequestMethod("POST");
            connection.setRequestProperty("Content-Type", headerContentType);
            connection.setRequestProperty("apikey ", apikey);
            connection.setRequestProperty("token", MerchantToken);
            connection
                    .setRequestProperty("Authorization", authorizationHeader);
            connection.setRequestProperty("timestamp", ""+epoch);
            connection.setRequestProperty("nonce", ""+nonce);
            connection.setDoOutput(true);
            connection.setReadTimeout(30000);

            // Send request
            DataOutputStream wr = new DataOutputStream(connection.getOutputStream());
            wr.writeBytes(urlParameters);
            wr.flush();
            wr.close();

            // Get Response
            InputStream is = connection.getInputStream();
            BufferedReader rd = new BufferedReader(new InputStreamReader(is));
            String line;
            StringBuffer response = new StringBuffer();
            while ((line = rd.readLine()) != null) …
Run Code Online (Sandbox Code Playgroud)

java payment-gateway

5
推荐指数
1
解决办法
1848
查看次数

将项目从eclipse迁移到工作室时,任务':app:transformClassesWithDexForDebug'的执行失败

我试图在工作室中运行我的代码,但不断收到此错误: -

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformClassesWithInstantRunForDebug'.
> Unexpected constructor structure.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Run Code Online (Sandbox Code Playgroud)

我尝试了很多方法来解决这个错误,但似乎没有什么对我有用

以下是我的代码中最初出现此错误时所做的事情: -

来自FragmentActivity的片段调用: -

  public void showSelectVideoFragment() {

        // TODO Auto-generated method stub
        if (checkCurrentSelectedBtForLeftMenu(lMenuBtUploadVideoWRAP)) {
            return;
        }

        setBtBackgroundForLeftMenu(lMenuBtUploadVideoWRAP);
        addFragment(new SVideoFragment(mLeftMenu));
    }

private void addFragment(Fragment fragment) {
        if (fragmentManager != null) {
            if (fragmentManager.getBackStackEntryCount() == …
Run Code Online (Sandbox Code Playgroud)

constructor android-fragments android-studio

5
推荐指数
1
解决办法
2118
查看次数