| | |
| | | * @return |
| | | */ |
| | | 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<>(); |
| | |
| | | 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); |
| | |
| | | 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; |
| | | } |
| | | |