| | |
| | | import com.stylefeng.guns.modular.system.util.Tingg.model.CheckoutRequest; |
| | | import io.cellulant.model.Payload; |
| | | import io.cellulant.service.CheckoutEncryption; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.BufferedReader; |
| | |
| | | /** |
| | | * Tingg支付工具类 |
| | | */ |
| | | @Slf4j |
| | | public class TinggPayUtil { |
| | | |
| | | private static String accessKey = "8rc1gTV9n91Tc1Sy9oVWry99fgrgrVV8concf9onWooWSg9TVW8nSgo98g88"; |
| | |
| | | CheckoutEncryption checkoutEncrption = new CheckoutEncryption(ivKey, secretKey); |
| | | Payload payload = getPayload(checkoutRequest); |
| | | String param = checkoutEncrption.encrypt(payload); |
| | | System.out.println("Encrpted payload=" + param); |
| | | log.error("调起支付:" + checkoutRequest.getMerchantTransactionId() + "\nEncrpted payload=" + param); |
| | | String url = "https://checkout.tingg.africa/express/checkout?encrypted_payload=" + param + "&access_key=" + accessKey; |
| | | return ResultUtil.success(url); |
| | | }catch (Exception e){ |