Skip to content

Instantly share code, notes, and snippets.

@bnguyen06
Last active April 13, 2019 06:46
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 bnguyen06/7049383695fd93ec48db6db14eccc9d6 to your computer and use it in GitHub Desktop.
Save bnguyen06/7049383695fd93ec48db6db14eccc9d6 to your computer and use it in GitHub Desktop.
<html>
<script src="//app.resolvepay.com/js/resolve.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$().ready(function() {
$('#btn-order').click(function() {
resolve.checkout({
merchant: {
id: 'MERCHANT_ID',
success_url: 'MERCHANT_WEBSITE/confirm',
cancel_url: 'MERCHANT_WEBSITE/cancel'
},
customer: {
first_name: 'First',
last_name: 'Last',
phone: '',
email: 'first_last@gmail.com',
},
shipping: {
name: 'First Last',
company_name: 'Company Name', // optional
phone: '4153334567',
address_line1: '633 Folsom St',
address_line2: 'FL 7', // optional
address_city: 'San Francisco',
address_postal: '94017',
address_country: 'US',
},
billing: {
first_name: 'First',
last_name: 'Last',
phone: '4153334567',
},
items: [{
name: 'Product Name',
sku: 'ABC-123',
unit_price: 19.99,
quantity: 3,
}],
order_number: '', // (optional) merchant order number
po_number: '', // (optional) buyer purchase order number if required
shipping_amount: 0.00,
tax_amount: 5.00,
total_amount: 64.97,
});
});
});
</script>
<body>
<button id="btn-order">Place Order</button>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment