Quantcast
Channel: Square Developer Forums - Latest topics
Viewing all articles
Browse latest Browse all 1325

How do I get the new SCA payment flow to work?

$
0
0

Hello there!

I’m currently trying out the new SCA payment flow, which is described. The documentation (Take a Card Payment) says I need to pass the new parameters to the “tokenize()” method. But there is no global “tokenize” method. I think this code snippet refers to GitHub - square/web-payments-quickstart: Quickstart for using Square's Web Payments SDK. Specifically to /public/examples/card-payment.html. Can you please help me understand how exactly I should pass the new parameters to “Card.tokenize()”?

I created a fork of this repository and tried to implement the new SCA payment flow but it doesn’t work.

I tried the following code:

const tokenResult = await paymentMethod.tokenize(
  {
    billingContact: billingContact, 
    intent: 'CHARGE', 
    sellerKeyedIn: 'FALSE', 
    customerInitiated: 'TRUE', 
    total: total
  }
);

I also tried this:

const tokenResult = await paymentMethod.tokenize(
  billingContact, 
  'CHARGE', 
  'FALSE', 
  'TRUE', 
  total
);

What mistake have I made?

Here’s the error I’m getting:

{
  code: 'CARD_DECLINED_VERIFICATION_REQUIRED',
  detail: "Authorization error: 'CARD_DECLINED_VERIFICATION_REQUIRED'",
  category: 'PAYMENT_METHOD_ERROR'
}

It looks like an error if “verifyBuyer” hasn’t been invoked. But in the (beta) new payment flow this method is deprecated.

Without changes (when the code calls “verifyBuyer”) everything works fine with test cards with a challenge type “Modal with verification code”.

Any help is appreciated.

Best regards,
Max Eliseev

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 1325

Trending Articles