Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mattbrailsford/593fc2e4f01778c0186e5848a064f784 to your computer and use it in GitHub Desktop.
Save mattbrailsford/593fc2e4f01778c0186e5848a064f784 to your computer and use it in GitHub Desktop.
return new PaymentFormResult()
{
Form = new PaymentForm(cancelUrl, FormMethod.Get)
.WithAttribute("onsubmit", "return handlePaylikeCheckout(event)")
.WithJsFile("//sdk.paylike.io/3.js")
.WithJs(@"
var paylike = Paylike('" + publicKey + @"');
window.handlePaylikeCheckout = function (e) {
e.preventDefault();
paylike.popup({
currency: 'EUR',
amount: 10000,
custom: {
orderId: '"+ order.Id +@"',
},
}, function( err, res ){
if (err)
return console.log(err);
location.href = '"+ continueUrl + @"';
});
return false;
}
")
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment