Hello
Am trying to make an online reservation form, whereby user will input details, and select credit card as payment method, and i want the form to connect to paypal and then process the credit card payment details, using the webform details entered.
Am new to this, and do not know exactly how to make the webform submit to paypal for the processing steps. Anyone can pls help?

Dani AI

Generated

A concise, practical path for (building a reservation form) that builds on ’s pointer to PayPal’s API and ’s “step‑by‑step” idea: don’t post raw card numbers through your server unless you must. Modern options are:

  • Redirect/hosted PayPal Checkout (buyer leaves your page) — lowest PCI burden.
  • Recommended: PayPal’s CardFields (Advanced Checkout) or a PayPal/Braintree hosted‑fields integration — card inputs are rendered by the provider and PAN never traverses your servers.
  • Legacy: Direct Payments / Payflow / Payments Pro that send PAN through your backend — requires full PCI scope and is generally avoidable for small sites. (developer.paypal.com)

Practical step sequence for the reservation form

  1. Create a PayPal Business account and a REST API app in the PayPal Developer Dashboard to get client_id / client_secret.
  2. On checkout load the PayPal JavaScript SDK and render CardFields (or Braintree Hosted Fields) so card entry is isolated from your servers.
  3. When the customer submits, POST to your server to create an order (Orders v2 API) and return the order ID to the client.
  4. Let the client/widget finish the 3DS flow if required, then call your server to capture the order (v2/checkout/orders/{id}/capture).
  5. Use webhooks for asynchronous confirmations (and implement idempotency). Always use HTTPS, validate/sanitize all non‑card fields, and never store PAN/CVV. Test thoroughly in sandbox before going live. (developer.paypal.com)

Minimal PHP example (server-side: create an order)

// assume $accessToken obtained via v1/oauth2/token using client_id:secret
$payload = [
  'intent' => 'CAPTURE',
  'purchase_units' => [
    ['amount' => ['currency_code'=>'USD','value'=>'100.00'],
     'description'=>'Reservation #1234']
  ]
];

$ch = curl_init('https://api-m.sandbox.paypal.com/v2/checkout/orders');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
  'Content-Type: application/json',
  "Authorization: Bearer $accessToken"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$res = curl_exec($ch);
curl_close($ch);
$order = json_decode($res, true);
echo $order['id']; // return to client for CardFields/JS to continue

The client-side CardFields flow then calls your capture endpoint to finish payment. (developer.paypal.com)

Troubleshooting & compliance notes

  • Ensure Advanced Credit & Debit Card Payments is enabled in your sandbox/business account before testing.
  • Verify webhooks using PayPal’s verification API and build idempotent webhook processing to avoid double fulfillment.
  • Confirm which SAQ applies (SAQ A vs A‑EP) with your acquirer or QSA — hosted fields/tokenization reduce PCI scope but don’t eliminate governance. (developer.paypal.com)

This gives a secure, testable workflow for integrating a reservation webform with PayPal while minimizing PCI exposure and keeping the UX smooth.

Recommended Answers

All 3 Replies

Hi,

Check out PayPal's API. It should have instructions on how to do this, depending on the language you are using (PHP, etc).

commented: thanks +1

Paypal has a step by step process. Follow it and it will be super easy.

thanks for the replies

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.