无需用户交互的PayPal支付方案咨询:寻找已弃用方法的替代选项
Hey there! Great question—since DoReference Transactions and Recurring Payments are no longer supported, PayPal offers two modern, reliable alternatives to handle on-demand, no-user-interaction payments after an initial user authorization:
1. PayPal Vault API (Best for On-Demand, One-Time Payments)
This is the direct replacement for DoReference Transactions. It lets you securely store a user's PayPal account or card details after their first login/authorization, then use that stored payment source to initiate payments anytime without requiring the user to log in again.
How it works:
- Step 1: Have the user complete an initial authorization flow (using PayPal's standard checkout UI) to grant permission for you to store their payment method.
- Step 2: Use the Vault API to save their payment source (you'll get a
payment_source_idfor future use). - Step 3: When you need to charge the user later, create an Order via the REST API, specify the stored
payment_source_id, and capture the payment—all without any user interaction.
Example code snippet (simplified):
To create an order using a vaulted payment source:
curl -v -X POST https://api-m.sandbox.paypal.com/v2/checkout/orders \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -d '{ "intent": "CAPTURE", "purchase_units": [ { "amount": { "currency_code": "USD", "value": "10.00" }, "payment_source": { "vault": { "id": "VAULTED_PAYMENT_SOURCE_ID" } } } ] }'
2. PayPal Subscriptions API (Best for Recurring or Scheduled Payments)
If your use case involves recurring charges (even with occasional on-demand adjustments), the Subscriptions API replaces the old Recurring Payments. While it's designed for regular billing cycles, you can also add one-time "add-ons" to an active subscription without user interaction, as long as the initial subscription was authorized by the user.
Key features:
- Set up fixed or flexible billing cycles (monthly, annual, custom intervals).
- Add one-time charges to an existing subscription for on-demand needs.
- Manage subscription statuses (pause, resume, cancel) programmatically.
Important Notes:
- Both APIs require you to have a PayPal Business account and enable the necessary features in your PayPal Developer Dashboard.
- Always ensure you comply with PayPal's terms of service, especially regarding user consent for stored payment methods and recurring charges.
内容的提问来源于stack exchange,提问作者Michael Ebenstein

