xuhy
2023-12-12 9e09fbcbd57a2b2258ba3a783231f1c86ca699ba
UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/Tingg/TinggPayoutUtil.java
@@ -37,12 +37,13 @@
     * @param narration             备注
     * @return
     */
    public PayoutResponse sendPayout(String phone, String payerTransactionID, Double amount, String callbackUrl, String narration) {
    public PayoutResponse sendPayout(String serviceCode, String phone, String payerTransactionID, Double amount, String callbackUrl, String narration) {
        System.err.println("进入支付转账业务");
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Credentials credentials = new Credentials("igo_api_user", "mXo%kJM.p;_i)SSZ&^b?6XSH)D+OCPh8");
        List<Packet> packets = new ArrayList<>();
        Packet packet = new Packet();
        packet.setServiceCode("GH-TIGO-B2C");//手机网络运营商 GH-MTN-B2C、GH-TIGO-B2C、GH-VODAFONE-B2C、GH-AIRTEL-B2C
        packet.setServiceCode(serviceCode);//手机网络运营商 GH-MTN-B2C、GH-TIGO-B2C、GH-VODAFONE-B2C、GH-AIRTEL-B2C
        packet.setMSISDN(phone);
        packet.setAccountNumber(phone);
        packet.setPayerTransactionID(payerTransactionID);
@@ -56,7 +57,7 @@
        Payout payout = new Payout("GH", "BEEP.postPayment", payload);
        String string = JSON.toJSONString(payout);
        string = string.replace("mSISDN", "MSISDN");
        System.err.println(string);
        System.err.println("支付参数" + string);
        HttpHeaders headers = new HttpHeaders();
        MediaType type = MediaType.parseMediaType("text/plain");
        headers.setContentType(type);
@@ -66,7 +67,7 @@
        String url = "https://apps.cellulant.co.ke:9801/globalApi/v2/JSON/";
        String s = restTemplate.postForObject(url, formEntity, String.class);
        PayoutResponse payoutResponse = JSON.parseObject(s, PayoutResponse.class);
        System.err.println(s);
        System.err.println("支付结果返回" + s);
        return payoutResponse;
    }