2
0

feat: paypal配置

This commit is contained in:
caiyuchao
2025-04-29 18:03:46 +08:00
parent e9765d7d39
commit 01f4a5c3d6
7 changed files with 109 additions and 12 deletions

View File

@@ -6,6 +6,7 @@ import com.paypal.sdk.authentication.ClientCredentialsAuthModel;
import com.paypal.sdk.models.Order;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -13,6 +14,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;
import org.wfc.common.core.domain.R;
import org.wfc.common.core.utils.AESUtil;
import org.wfc.payment.domain.PayPalBean;
import org.wfc.payment.pay.paypal.service.IPayPalService;
@@ -67,6 +69,12 @@ public class PayPalController {
}
}
@GetMapping("/result/one")
public R<String> getPaypalConfig()
{
return R.ok(AESUtil.encrypt(payPalBean.getClientId()));
}
@PostMapping("/orders/{paypalOrderId}/capture/{orderId}")
public R<Order> captureOrder(@PathVariable String paypalOrderId, @PathVariable Long orderId) {
try {

View File

@@ -80,4 +80,4 @@ paypal:
stripe:
secret-key: sk_test_51RHGN8FwutpVO5TqqmAkJNYMlWDPgwj4NVKPxcPKEXMGSPpEZ4yKwpGancV1vyPP74Pk3ETPUdAws0CfiH1jTN9v00kQ64suj5
domain: http://192.168.6.222/u
endpoint-secret: whsec_rD5GFCx37wIS3Ag67ocPHWoD2WGIfWyC
endpoint-secret: whsec_zBaAhDlSc6AdNBlbLzmbT0mfGCikA8IT