PayPal
Order (pemakaian oleh agent dibatasi nominal dan mata uang), capture, refund, draft invoice, saldo dan transaksi. Capture, refund, kirim invoice dan payout hanya lewat node
Beta v0.1.0 Node.js 19 aksi
Tentang
Plugin Graphrt untuk PayPal REST API. Mencakup Orders v2 (buat, ambil, capture, authorize), capture, otorisasi dan refund, Invoicing v2 (draft invoice), Payouts, serta laporan (saldo, transaksi). Dibuat dengan lapisan REST deklaratif (definition.mjs) ditambah wrapper kecil untuk keamanan agent di lib/.
Yang bisa dilakukan
- Orders: create_order (returns the buyer's approve link), get_order, capture_order, authorize_order
- Payments: get_capture, refund_capture, get_refund, get_authorization, capture_authorization, void_authorization
- Invoices: list_invoices, get_invoice, create_invoice (draft), send_invoice
- Account: get_balances, list_transactions (up to 31 days per call)
- Payouts: create_payout, get_payout_batch
- api_request: any other endpoint (agents: GET and allowlisted paths only)
Aksi
Setiap aksi adalah langkah yang bisa ditambahkan ke workflow. Agent juga bisa memakai sebagian besar aksi sebagai tool.
- Create order
paypal.create_order - Get order
paypal.get_order - Capture order
paypal.capture_order - Authorize order
paypal.authorize_order - Get capture
paypal.get_capture - Refund capture
paypal.refund_capture - Get refund
paypal.get_refund - Get authorization
paypal.get_authorization - Capture authorization
paypal.capture_authorization - Void authorization
paypal.void_authorization
Tampilkan semua 19 aksi
- List invoices
paypal.list_invoices - Get invoice
paypal.get_invoice - Create draft invoice
paypal.create_invoice - Send invoice
paypal.send_invoice - Get balances
paypal.get_balances - List transactions
paypal.list_transactions - Create payout
paypal.create_payout - Get payout batch
paypal.get_payout_batch - PayPal REST API request
paypal.api_request
Pengaturan
Graphrt menyalakan plugin dengan environment yang bersih. Hanya nilai ini yang sampai ke plugin, dan secret tidak masuk log.
-
PAYPAL_CLIENT_IDWajibREST app client id -
PAYPAL_CLIENT_SECRETWajibREST app secret (OAuth2 client credentials, the token is cached in memory) -
PAYPAL_ENVOpsionalsandbox (default, api-m.sandbox.paypal.com) or live (api-m.paypal.com) -
PAYPAL_TOOL_ALLOW_ORDERSOpsional1 lets agent tools create orders, within the cap below -
PAYPAL_TOOL_MAX_AMOUNTFor agent ordersMaximum total of an agent-created order (sum of purchase_units[].amount.value, major unit, e.g. 50 = $50). Unset or 0 refuses every one -
PAYPAL_TOOL_ALLOWED_CURRENCIESFor agent ordersComma-separated currencies agents may use, e.g. USD. Unset refuses every agent order -
PAYPAL_TOOL_ALLOW_INVOICESOpsional1 lets agent tools create draft invoices (item totals within PAYPAL_TOOL_MAX_AMOUNT) -
PAYPAL_TOOL_ALLOWED_RETURN_HOSTSOpsionalComma-separated hosts agent orders may use in return_url / cancel_url (any https host when unset) -
PAYPAL_TOOL_API_EXTRA_PATHSOpsionalMore GET paths agents may reach with api_request, comma-separated, * = one segment
Cara memakainya
Di Graphrt Desktop
- Buka Plugins dan cari PayPal.
- Klik Install lalu setujui.
- Ikuti langkah setup di halaman plugin, lalu tempel pengaturan yang dibutuhkan.
- Jelaskan pekerjaan yang membutuhkannya, dan builder menambahkan langkahnya.
Dengan CLI
terminal
$ graphrt plugin install paypal workflow.yaml
- id: order
type: paypal.create_order
purchase_units: [{ reference_id: "{{#start.order_id#}}", amount: { currency_code: USD, value: "25.00" } }]
return_url: https://shop.example/paypal/return
cancel_url: https://shop.example/paypal/cancel
- id: capture # after the buyer approved
type: paypal.capture_order
order_id: "{{#order.data.id#}}"