簡體   English   中英

Paypal 訂閱 webhook 用於定期付款

[英]Paypal subscription webhook for recurring payment

我已經設置了 Paypal webhook 來跟蹤經常性付款。 我已經為

  1. 計費.訂閱.更新
  2. 計費.訂閱.重新激活
  3. 計費.訂閱.續訂
  4. 計費.訂閱.取消
  5. 計費.訂閱.過期
  6. 計費.訂閱.暫停
  7. 計費.訂閱.支付.失敗
  8. 計費.訂閱.激活

除了激活之外,我沒有收到任何事件。 誰能幫我找出我需要設置的掛鈎來跟蹤定期訂閱計費的交易?

謝謝

請參閱https://developer.paypal.com/docs/integration/direct/webhooks/event-names/#subscriptions

看起來你想要PAYMENT.SALE.COMPLETED

還有一種用於退款和撤消。

在 webhook 模擬器中 PAYMENT.SALE.COMPLETED 未完全顯示,但在訂閱付款時使用它是正確的。 它還有一個 subscription_id(由於某種原因它稱為billing_agreement_id )。

{
    "id": "WH-528005538C798144N-7H391362AP602264K",
    "create_time": "2021-04-17T22:45:35.950Z",
    "resource_type": "sale",
    "event_type": "PAYMENT.SALE.COMPLETED",
    "summary": "Payment completed for CAD 14.55 CAD",
    "resource": {
        "billing_agreement_id": "I-37B4TLL0FAJJ",
        "amount": {
            "total": "14.55",
            "currency": "CAD",
            "details": {
                "subtotal": "14.55"
            }
        },
        "payment_mode": "INSTANT_TRANSFER",
        "update_time": "2021-04-17T22:44:02Z",
        "create_time": "2021-04-17T22:44:02Z",
        "protection_eligibility_type": "ITEM_NOT_RECEIVED_ELIGIBLE,UNAUTHORIZED_PAYMENT_ELIGIBLE",
        "transaction_fee": {
            "currency": "CAD",
            "value": "0.72"
        },
        "protection_eligibility": "ELIGIBLE",
        "links": [
            {
                "method": "GET",
                "rel": "self",
                "href": "https://api.sandbox.paypal.com/v1/payments/sale/44P499886K055384U"
            },
            {
                "method": "POST",
                "rel": "refund",
                "href": "https://api.sandbox.paypal.com/v1/payments/sale/44P499886K055384U/refund"
            }
        ],
        "id": "44P499886K055384U",
        "state": "completed",
        "invoice_number": ""
    },
    "status": "PENDING",
    "transmissions": [
        {
            "webhook_url": "https://webhook.site/7ece4e68-de87-46df-a341-5d3dc580efe6",
            "transmission_id": "b02ef980-9fce-11eb-b0ec-5bc241fbaaf3",
            "status": "PENDING"
        }
    ],
    "links": [
        {
            "href": "https://api.sandbox.paypal.com/v1/notifications/webhooks-events/WH-528005538C798144N-7H391362AP602264K",
            "rel": "self",
            "method": "GET",
            "encType": "application/json"
        },
        {
            "href": "https://api.sandbox.paypal.com/v1/notifications/webhooks-events/WH-528005538C798144N-7H391362AP602264K/resend",
            "rel": "resend",
            "method": "POST",
            "encType": "application/json"
        }
    ],
    "event_version": "1.0"
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM