Confirm Payment Source

Easyship integrate with Stripe Setup Intent to collect credit card information.

Here's a example of how you can process 3DS on the client side. Once the validation is completed, you can use the to finalize the payment source in Easyship.

      <form id="form">
          <span>Intent Secret</span>
          <input id="secret" class="field" placeholder="" />
        <div class="button-row">

      <script src=""></script>
        // Retrieve Easyship stripe publishable api key through `GET /2023-01/account/stripe`
        var stripe = Stripe('Easyship_stripe_publishable_api_key');

        // Handle form submission and trigger 3DS
        var form = document.getElementById('form');
        form.addEventListener('submit', function (event) {

          var secret = document.getElementById('secret').value;

          stripe.confirmCardSetup(secret).then(function (result) {
            if (result.error) {
              // error handling
            } else {
              // You would receive the `setup intent id` with prefix `seti_`.
              // `POST /2023-01/payment_sources/confirm_3ds` here to finalize the payment source in Easyship

Should the setup intent not have undergone 3D Secure, you'll receive a status code 202, indicating the need to process 3D Secure.

Required authorization scope: Payment Source

This API is currently in beta and is available upon request. Get in touch with your account manager or Easyship Support Team to enable it.

Click Try It! to start a request and see the response here!