Generating a payment form
- Step 1: Building the form
The PayPal payment method does not require any extra mandatory fields in addition to your current integration.
However, it is recommended to send the order ID (vads_order_id field). See: Configuring the Block accidental payments option.
If you have opted for the merchant protection program, you must transmit the buyer’s details, the order and the shipping details in your payment form.
Three additional fields must be transmitted:
Field name Description vads_shipping_amount Shipping fees for the entire order.
The amount is expressed in the smallest currency unit. E.g.: 4525 for EUR 45.25
vads_tax_amount Tax amount for the entire order.
The amount is expressed in the smallest currency unit. E.g.: 4525 for EUR 45.25
vads_insurance_amount Insurance amount for the entire order.
The amount is expressed in the smallest currency unit. E.g.: 4525 for EUR 45.25
The value of the vads_amount field must correspond to the total amount of the order:
vads_amount = Sum ( vads_product_qty(N) x vads_product_amount(N) ) + vads_shipping_amount + vads_tax_amount + vads_insurance_amount.
See “Using additional features” in the Hosted Payment Page guide.
When the vads_page_action field is set to ASK_REGISTER_PAY:- An intermediary page is displayed in the buyer’s journey.
- The payment gateway prompts the buyer to save their payment method details for future purchases.
- The buyer must decide before redirection to PayPal whether they accept the token creation or not.
- Step 2: Managing the payment methods offered to the buyer
It is possible to customize the payment methods offered to the buyer by using the vads_payment_cards field.
Examples:
Use case Field values vads_payment_cards Offer all the eligible payment methods missing or empty Offer only the PayPal payment button in production mode. PAYPAL Offer only the PayPal payment button in test mode. PAYPAL_SB Offer the choice between VISA, PayPal and PayPal Pay Later in production mode. VISA;PAYPAL;PAYPAL_BNPL Offer the choice between VISA, PayPal and PayPal Pay Later in test mode. VISA;PAYPAL_SB;PAYPAL_BNPL_SB See chapter “Managing the payment methods offered to the buyer” of the Hosted Payment Page guide.