1.5 KiB
1.5 KiB
PayPal Payments
PayPal is available as a payment method alongside Stripe and crypto (XMR/DOGE).
Shop Setup
- Go to https://developer.paypal.com/dashboard/
- Create an app (sandbox for testing, live for production)
- Copy Client ID and Secret
- In Shop Settings → PayPal Settings, enter credentials and save
Configuration
Global settings in development.ini:
app.payments.paypal.enabled = True
app.paypal.sandbox_mode = True
Or environment variables:
export MPS_PAYMENTS_PAYPAL_ENABLED=True
export MPS_PAYPAL_SANDBOX_MODE=True
How It Works
- Each shop configures their own PayPal credentials
- PayPal button appears at checkout when enabled
- Payment info stored on Invoice (
paypal_order_id,paypal_capture_id) Invoice.payment_methodreturns "paypal" for PayPal payments- Saved payment methods stored in
PayPalUserShop
Code
make_post_sell/views/cart.py- PayPal checkout functions (paypal_create_order,paypal_complete_checkout)make_post_sell/views/billing.py- Disconnect saved PayPalmake_post_sell/views/paypal_webhooks.py- Webhook handler
Database
mps_shop columns:
paypal_client_id- Shop's PayPal Client IDpaypal_secret- Shop's PayPal Secretpaypal_enabled- Toggle PayPal on/off
mps_invoice columns:
paypal_order_id- PayPal order referencepaypal_capture_id- PayPal capture reference
mps_paypal_user_shop table:
- Tracks saved PayPal payment methods per user/shop