Ryan
Ryan

Reputation: 1051

SecurionPay custom integration Checkout via JavaScript

I am looking at using SecurionPay to take payments online. However I am finding problems with quite a simple task setting the amount and currency. It seems to keep defaulting.

I am trying to implement the system via JavaScript on and ASP.NET project.

https://securionpay.com/docs/checkout#custom-integration

On the above link it shows exactly how to call up the checkout system (code below exact copy and paste):

<script src = "https://securionpay.com/checkout.js"> </script>
<script src="https:/ / ajax.googleapis.com / ajax / libs / jquery / 3.1.0 / jquery.min.js "></script>
<script type="
text / javascript ">
  $(function () {
    SecurionpayCheckout.key = 'pk_test_ZVhCjD2Gz7OF222L00bxIdlD';
    SecurionpayCheckout.success = function (result) {
      // handle successful payment (e.g. send payment data to your server)
    };
    SecurionpayCheckout.error = function (errorMessage) {
      // handle integration errors (e.g. send error notification to your server)
    };
  
    $('#payment-button').click(function () {
      SecurionpayCheckout.open({
        checkoutRequest: 'NTQ1NDAwYTczZTljMjUwYzNhZjA0NTdkOTFjNThiOTY5YzIxY2ViMjBhMDRmOTYwNjg1MDI3OWQ2OTZlN2VjMnx7ImNoYXJnZSI6eyJhbW91bnQiOjQ5OSwiY3VycmVuY3kiOiJFVVIifX0=',
        name: 'SecurionPay',
        description: 'Checkout example'
      });
    });
  });
</script>

<button id="payment-button">Payment button</button>

However from my side I cannot change the charge or the currency? Any help would be welcome or any examples of an integration of the SecurionPay system on a Web Forms project would be appreciated.

Upvotes: 2

Views: 533

Answers (2)

Marcin Jancewicz
Marcin Jancewicz

Reputation: 651

Signed CheckoutRequest can be created in two ways:

  1. Use dedicated SDK. In your case it would be https://github.com/securionpay/securionpay-net. You should look for SecurionPayGateway.SignCheckoutRequest method.
  2. https://securionpay.com/docs/checkout-request-generator

Upvotes: 2

Ryan
Ryan

Reputation: 1051

I found out that it is the checkoutRequest was my issue:

Basically adjust this string to set a charge and currency.

checkout-request-generator

https://securionpay.com/docs/checkout-request-generator

Upvotes: 1

Related Questions