| | |
| | | package com.stylefeng.guns.modular.system.utils; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.stripe.Stripe; |
| | | import com.stripe.exception.*; |
| | | import com.stripe.model.Customer; |
| | |
| | | import com.stripe.param.PaymentIntentUpdateParams; |
| | | import com.stripe.param.PaymentMethodListParams; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.HashMap; |
| | | import java.util.logging.Logger; |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | try { |
| | | |
| | | String cus_odnGgggJJ7iEJh = getMethod("cus_OdnGgggJJ7iEJh"); |
| | | JSONObject jsonObject = JSON.parseObject(cus_odnGgggJJ7iEJh); |
| | | Object id1 = jsonObject.get("id"); |
| | | long l = 1; |
| | | Boolean pay = PaymentProcessor.pay("cus_odnGgggJJ7iEJh", id1.toString(), l); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | public static Boolean pay(String cus,String method,Long money) throws StripeException { |
| | | Stripe.apiKey = "sk_test_51Mu5D0KDN0sswRVwUNL5998QrX1VJkNrLsflVUXkEFH0cY2l9StrCc5O4c9gtzs7tLbVmeaTfyNL6pnrtw1tRClA00ZVfbNb3d"; |
| | | // Stripe.apiKey = "sk_test_51Mu5D0KDN0sswRVwUNL5998QrX1VJkNrLsflVUXkEFH0cY2l9StrCc5O4c9gtzs7tLbVmeaTfyNL6pnrtw1tRClA00ZVfbNb3d"; |
| | | Stripe.apiKey = "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"; |
| | | PaymentIntentCreateParams params = |
| | | PaymentIntentCreateParams.builder() |
| | | .setCurrency("usd") |