-
-
Save donutdan4114/ed3a7745c07bc2c8e596880fc07640dc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://cdn.apps.bonify.io/customer_fields/public/live/CustomerFieldsApp_Manual-min.js"></script> | |
<script> | |
if (typeof CustomerFieldsApp_Manual !== 'undefined') { | |
CustomerFieldsApp_Manual.init("#create_customer", { | |
base_url: "https://apps.bonify.io/", | |
site_id: "{{ shop.metafields.cf_app.internal_site_id }}", | |
shop_domain: "{{ shop.permanent_domain }}", | |
{% if customer %} | |
customer_id: "{{ customer.id }}", | |
customer_token: "{{ customer.metafields.cf_app.api_token }}", | |
{% endif %} | |
// Callback when new customer creation fails. | |
onNewCustomerFailure: function (data){ | |
// @todo: Exists for demo purposes only, remove if not needed. | |
console.log(data.result.responseJSON.errors); | |
}, | |
// Callback when updating a customer fails. | |
onUpdateCustomerFailure: function (data){ | |
// @todo: Exists for demo purposes only, remove if not needed. | |
console.log(data.result.responseJSON.errors); | |
}, | |
// Callback whenever a message should be displayed to the user. | |
onDisplayMessage: function(data){ | |
// @todo: Exists for demo purposes only, remove if not needed. | |
console.log(data); | |
}, | |
// Callback when a field has an error. | |
onFieldError: function (error){ | |
// @todo: Exists for demo purposes only, remove if not needed. | |
console.log(error); | |
} | |
}); | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment