Shopify Settings
Access https://www.shopify.com/ and log in.
Click on “Settings”.
Select “Apps and sales channels”.
Select “Develop Apps”.
Click on “Allow app custom development”, and confirm it.
Select “Create an app”.
Type “BAP”, and then click on “CreateApp”.
Go to “API Credentials”.
Click on “Selected”, and mark the following ones:
Go to “App Settings”. In “App Information”, type “Beer Awards Platform” in the field “Description”. Then click on “Save”.
After that, click on “Install App”. Then click on “Install”.
Once installed, open BAP as an admin, and go to Settings => Payments. Click on the Shopify line. The fields need to be completed are presented below, and the places in which you can obtain that information in Shopify are also shown.
Shopify store domain: here is were you copy your store's URL, usually following the pattern store-id.myshopify.com.
Storefront Access Token: Storefront API Access Token.
Shared Secret: API Secret Key.
Admin API Key: API Key.
Admin API Password: Admin API Access Token.
These are necessary to receive notifications when an order is paid, and to automatically mark as paid and processed in BAP. In case the order is canceled on Shopify, it is also canceled in BAP.
After that, you need to create a product in Shopify. Go back to the Shopify screen and click on your top left corner where you'll find the “Shopify” icon:
Click on “Products”, and then “Add product” (top right corner).
Complete these fields (the Price should be the same as the one in the Settings => Registration menu in BAP):
In BAP, the list of products available for sale in the store will be loaded. Select what the inscription represents. When selected, the productId and variantId fields will be filled, but they are for internal use in BAP. Don’t forget to click on “Save” in BAP!
And that’s it! Now, the option to pay with Shopify will be presented for the participant in the cart, directing them to provide their payment information on Shopify.
Redirecting to BAP after payment
After payment confirmation, the participant is not automatically redirected to their order in BAP, staying on the Shopify payment lookup screen. To enable redirection, you need to configure the following script in your store under Settings => Checkout => Orderprocessing => Additional Scripts:
<h3 style="font-size: 1.5em; margin-top:3em">Redirecting back to BAP...</h3>
<script>
window.setTimeout(function(){
window.location ="https://us-central1-beer-awards-platform.cloudfunctions.net/shopifyRedirectFromOrder?shopifyOrderId="+ Shopify.checkout.order_id;
}, 5000);
</script>