【发布时间】:2020-12-06 14:22:03
【问题描述】:
我已经在 Paypal 中使用 Sandbox 成功实现了 webhook 集成。 现在我想让它更安全,以便只接受 Paypal 签名的通知。 我正在尝试使用
验证 webhook 签名https://developer.paypal.com/docs/api/webhooks/v1/#verify-webhook-signature_post
但它总是返回FAILURE。
请求是:
{"auth_algo":"SHA256withRSA","transmission_time":"2020-08-17T12:11:08Z","cert_url":"https://api.sandbox.paypal.com/v1/notifications/certs /CERT-360caa42-fca2a594-1d93a270","webhook_id":"0JD18557VD498931R","transmission_id":"bbaae190-e082-11ea-aa52-1fdbf2bc8461","webhook_event":{"summary":"5.0 美元的付款已完成","event_type":"PAYMENT.SALE.COMPLETED","create_time":"2020-08-17T12:11:05.015Z","resource":{"billing_agreement_id":"I-DNVD3H9UWYHL","amount": {"total":"5.00","currency":"USD","details":{"subtotal":"5.00"}},"payment_mode":"INSTANT_TRANSFER","update_time":"2020-08-17T12 :10:39Z","create_time":"2020-08-17T12:10:39Z","protection_eligibility_type":"ITEM_NOT_RECEIVED_ELIGIBLE,UNAUTHORIZED_PAYMENT_ELIGIBLE","transaction_fee":{"currency":"USD","value":" 0.45"},"protection_eligibility":"ELIGIBLE","links":[{"method":"GET","rel":"self","href":"https://api.sandbox.paypal.com /v1/payments/sale/8TV124151P468690Y"},{"method":"POST","rel":"refund","href":"https://api.sandbox.paypal.com/v 1/payments/sale/8TV124151P468690Y/refund"}],"id":"8TV124151P468690Y","state":"completed","invoice_number":""},"resource_type":"sale","links":[ {"href":"https://api.sandbox.paypal.com/v1/notifications/webhooks-events/WH-2XT265922L1486124-74F09092JL7840709","rel":"self","targetSchema":null,"method" :"GET","enctype":null,"schema":null},{"href":"https://api.sandbox.paypal.com/v1/notifications/webhooks-events/WH-2XT265922L1486124-74F09092JL7840709/重新发送","rel":"重新发送","targetSchema":null,"method":"POST","enctype":null,"schema":null}],"id":"WH-2XT265922L1486124-74F09092JL7840709" }, “transmission_sig”: “+ RYILWohVPkK0hUrMjTSU3 fCgd6NTgqkjrZtsOJiC7FR3U3atOK1k29 / Md8DQRReAicdfOpXrS7E4vrvB17HOM39w / D3i4Ohy34HL3CqSsZovL69lhfFmviCGkXjjSbkBhpKGJvQAB4q0E9AWl / SBZc4MUNGezIbk / laJZ6ikQuwGeEHCFaPVrza7kSlZRo03lM9sYSb7q3ixewYmz8voKIyJ2RYjOgsAohNFWgovtKwG + ac66YCp3ZRJLe4fL2Q1UaEDn5BnUhK + 5Q2 +的EqD + BixpqNTuSmYqRwkyDTdrH1EPV5DRU4uYM0gJLXnBovGaqHe8JujpVs + dJu4Mrmgdg ==”}
结果是
{"verification_status":"FAILURE"}
有人可以帮忙吗!!
【问题讨论】:
标签: spring-boot paypal paypal-sandbox paypal-subscriptions paypal-webhooks