小编Vem*_*van的帖子

如何从Fire基本服务器生成哈希以集成PAYU网关?

我想在我的Android应用程序中通过PAYU接受付款,但我没有服务器,因此我使用firebase存储数据.从视频https://youtu.be/gnQ0IF3XniM 我设法从视频 中提到的服务器集成PAYU支付网关.我从服务器生成哈希的代码如下:

    @Override
    protected PayuHashes doInBackground(String... postParams) {
        PayuHashes payuHashes = new PayuHashes();
        try {

            //TODO Below url is just for testing purpose, merchant needs to replace this with their server side hash generation url
            URL url = new URL("https://payu.herokuapp.com/get_hash");

            // get the payuConfig first
            String postParam = postParams[0];

            byte[] postParamsByte = postParam.getBytes("UTF-8");

            HttpURLConnection conn = (HttpURLConnection) url.openConnection();
            conn.setRequestMethod("POST");
            conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
            conn.setRequestProperty("Content-Length", String.valueOf(postParamsByte.length));
            conn.setDoOutput(true);
            conn.getOutputStream().write(postParamsByte);

            InputStream responseInputStream = conn.getInputStream();
            StringBuffer responseStringBuffer = new StringBuffer();
            byte[] byteContainer = new …
Run Code Online (Sandbox Code Playgroud)

android payment-gateway firebase payu

5
推荐指数
0
解决办法
318
查看次数

如何读取表示数组元素的以空格分隔的整数,并将它们用C求和

如何读取表示数组元素的空格分隔整数并在C中求和?我使用下面的代码,但它读取新行中的所有元素:

#include <math.h>
#include <stdio.h>
int main() {
    int i = 0, N, sum = 0, ar[i];
    scanf("%d" , &N);
    for (i = 0; i < N; i++) {
        scanf("%d", &ar[i]);
    }
    for (i = 0; i < N; i++) {
        sum = sum + ar[i];
    }
    printf("%d\n", sum);
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

c

2
推荐指数
1
解决办法
1213
查看次数

标签 统计

android ×1

c ×1

firebase ×1

payment-gateway ×1

payu ×1