PayPal Checkout Integration + "Ship To Store" delivery option for PayPal payments

The purpose of this document is to provide necessary information on how to enable the PayPal payment option on checkout.

In addition to this work, PayPal can now be enabled for "Ship To Store" delivery types.

Basket

👍

You need to ensure that under Store > Settings > Payment that "Use PayPal billing address" is ticked, so that the Billing Address is correctly extracted.

The customers PayPal billing address will only be used if it is available, required and the customer didn't enter a billing address during the checkout process. Please note that the "request billing address" feature will need to be enabled on your merchant PayPal account for this functionality to work correctly.

  • If a customer chooses the "Ship to Store" option, the chosen store address is used as the delivery address.
  • Delivery firstname/lastname will be copied from the billing firstname/lastname
  • This address is in "read only" mode, so cannot be changed by the customer.
  • Please note that to ensure this works on PayPals request, the name of the store is prefixed by "S2S " e.g. If store name set up in Aurora reads "Store 1", "S2S Store 1" will be used.
  • If the "Ship to Store" option was selected, but an actual store wasn't chosen, the user is sent back to this URL: "/basket?paypal_error=store" on express checkout attempt.

🚧

To retrieve the value of a GET parameter in Smarty, you can use: $smarty.get.name_of_variable. In this case, you can use: $smarty.get.paypal_error .

Checkout

To show the PayPal payment method in checkout, we will have to first locate the below Smarty {if} block:

{if $totalPaymentOptions > 1}
...
{/if}

Inside of this block, dependent on which order we would like the PayPal payment to be shown, the below code should be added:

{if $paypal_express}
<p>
<label class="checkout_label_radio" for="paypal_express">{site_text page="Checkout" part="Label: PayPal"}</label>
<input type="radio" class="radio" name="payment_type" id="paypal_express" value="paypal_express" {$page.payment_paypal_express} />
</p>
{/if}

🚧

$paypal_express - is true only if all below conditions are true

  • PayPal is enabled through "Aurora" > "Store" > "Settings" > "Payment Providers" > "PayPal Express Enabled?" (checkbox)
  • "Paypal Payment Provider" in "Aurora" > "Store" > "Settings" > "Payment Providers" is NOT "Disabled"
  • Total Cost of current order is greater than 0

🚧

$page.payment_paypal_express smarty variable is set to ' checked="checked" ' if checkout page is re-visited with PayPal previously chosen as payment method.