Skip to content

Instantly share code, notes, and snippets.

@sahildua2305
Created July 12, 2014 08:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sahildua2305/d47984bca5e506d247e4 to your computer and use it in GitHub Desktop.
Save sahildua2305/d47984bca5e506d247e4 to your computer and use it in GitHub Desktop.
Refiral Checkout Integration Code
<script type="text/javascript">var showButton = false;</script>
<script type="text/javascript">var apiKey = "YOUR_API_KEY";</script>
<script type="text/javascript" src="//rfer.co/api/v0/js/all.js"></script>
<script type="text/javascript">
var customer_name = "CUSTOMER_NAME"; // Replace CUSTOMER_NAME with the customer name
var customer_email = "CUSTOMER_EMAIL"; // Replace CUSTOMER_NAME with the customer email
var grandTotal = "GRAND_TOTAL"; // Replace GRAND_TOTAL with the total amount of the bill of customer
var subTotal = "SUBTOTAL"; // Replace SUBTOTAL with the subtotal amount of the bill of customer
var couponCode = "COUPON_CODE"; // Replace COUPON_CODE with the coupon code applied by customer. Leave it blank if no coupon code is applied.
// Push all products to refiral_cart_items array
var refiral_cart_items = [];
refiral_cart_items.push({
product_id: "P1", // Product ID
quantity: "2", // Quantity
name: "Product 1", // Name of product
price: '250.0' // Price of product
});
refiral_cart_items.push({
product_id: "P2", // Item Product ID
quantity: "1", // Item Quantity
name: "Product 2", // Name of product
price: '400.0' // Price of product
});
invoiceRefiral(subTotal, grandTotal, couponCode, refiral_cart_items, customer_name, customer_email);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment