Skip to content

Add basic SCA support

Compare
Choose a tag to compare
@deanpapastrat deanpapastrat released this 31 Oct 16:54
· 50 commits to master since this release
4984685

This release adds support for SCA returning a verificationToken as part of the handleCardNonceResponse callback when you provide a createVerificationDetails function to the SquarePaymentForm component.

The createVerificationDetails function should create an SqVerificationDetails object described in the SqPaymentForm reference.

Then, you can pass it to the component:

<SquarePaymentForm
  @createVerificationDetails={{action "createVerificationDetails"}}
  as |PaymentForm|
>
  {{!-- your form goes here --}}
</SquarePaymentForm>

You'll then be able to access the verificationToken as the last parameter in handleCardNonceResponse:

handleCardNonceResponse(
  errors,
  nonce,
  cardData,
  billingContact,
  shippingContact,
  shippingOption,
  verificationToken
) {
}