Token payment upgrade to 3DS: Difference between revisions

From Barion Documentation
Jump to navigation Jump to search
No edit summary
(30 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{PageTitle|title=Upgrading token payment implementation to use 3DS}}
{{PageTitle|title=Upgrading token payment implementation to comply with 3DS}}
{{NotificationBox|title=NOTE|text=This tutorial was created to help merchants that already have token payment integration with Barion. If you are planning to create a new integration, please read [[Token_payment_3D_Secure|this description]]!|color=#1993c7}}
__NOTOC__


[[Token_payment|Token payment]] is a solution that enables the merchant to charge the payer without requiring the presence of the payer. It is a powerful tool to conduct subscription-like or payer-not-present scenarios. This scenario required the merchant to create a token that would act as an identifier for the payer's funding source (may it be a credit card or a Barion e-money account). To acquire such a token the merchant had to do several things:
{{NotificationBox|title=NOTE|text=This tutorial was created to help merchants that already have token payment integration with Barion. First, please read through the detailed description of the new [[Token_payment_3D_Secure|token payment with 3DS]]!|color=#1993c7}}
# Create an alphanumeric token  
= Background =
# Register this token in the Barion system by attaching it to an initial payment and having the payer fulfill that payment (either by card or form an e-money account)
[[Token_payment|Token payment]] is a solution that enables the merchant to charge the payer without the presence of them. It is a powerful tool to conduct subscription-like or payer-not-present scenarios. This scenario requires the merchant to create a token that would act as an identifier for the payer's funding source. To attach that token to a valid funding source the merchant had to do several things:
# Create an alphanumeric token
# Conduct an initial payment in which this token gets registered in the Barion system  
# Refer to this token in a subsequent payment attempt
# Refer to this token in a subsequent payment attempt


This meant that as far as this token referred to a valid and still available funding source the merchant could create payments without any limitations. To make sure that the payer
[[File:Recurring-pre3ds.png|1280px]]


{{NotificationBox|title=IMPORTANT|text=Starting from January 1 the [[3DSecure|3DS authentication]] will be mandatory for all of our partners!|color=#FF7A3D}}
This meant that as far as this token referenced a valid (and still available) funding source the merchant could create payments without any limitations. Basically, this token symbolized the funding source. It was up to the merchant to decide what it is used for, neither Barion nor the card issuer was aware of the nature of the subsequent payments.
 
This funding source can be either a card or an e-money wallet and this is up to the payer to choose. In case the payer chooses to fund the payment from their e-money wallet there is no further need for extra security. On the other hand, when it comes to card payment the authentication process changed with the new Strong Customer Authentication directive and the 3DS v2 protocol.
 
= Changes =
To make sure that the payer has more control over these token scenarios and the card issuer knows more about the payment scenarios several things need to be changed.
 
== Token payment scenarios ==
 
First of all the merchant has to decide what kind of token payment scenario is suitable. These scenarios are the following:
* '''One-click payment''': The payer clicks on the "Purchase" button but the charge happens in the background without the payer leaving the merchant's site.
* '''Recurring payment''': The payer authorizes the merchant (at the initial payment) to charge their card periodically without being present with the same amount.
* '''Merchant initiated payment''': The payer authorizes the merchant to charge their card without restrictions (eg. amounts can vary).
 
To decide on a suitable scenario, please [[Token_payment_3D_Secure#Token_payment_scenarios|read this detailed description]]
 
{{NotificationBox|title=CHANGE|text=The intended scenario must be specified in the new [[RecurrenceType|ReccurenceType]] property (located in the [[Payment-Start-v2|Payment/Start]] request)|color=#20c400}}
 
== Usage of TraceId ==
 
3DS authentication requires another identifier. This new identifier is used to differentiate these token payment scenarios and help the issuer control what is a non-fraudulent transaction.
 
So from now on, there will be two IDs for every payer-not-present scenario:
* <code>RecurrenceId</code> for the funding source: this identifies the source of the money (could be card or wallet)
* <code>TraceId</code> (new) for the ''nature of the charge:'' this identifies the type of token payment scenario the merchant is conducting.
 
This new <code>TraceId</code> is generated and stored by the card issuer. The Id is available in the [[Payment-GetPaymentState-v2|GetPaymentState]] response once the charge is successfully completed.
 
{{NotificationBox|title=CHANGE|text=The TraceId must processed from the [[Payment-GetPaymentState-v2|GetPaymentState]] response and must be attached to the payment in merchant's system. |color=#20c400}}
 
Once the <code>TraceId</code> is acquired it must be sent in the [[Payment-Start-v2|Payment/Start]] request to identify the scenario. This is crucial for the card transactions otherwise they could be declined.
 
{{NotificationBox|title=CHANGE|text=The TraceId must specified in the [[Payment-Start-v2|Payment/Start]] for the subsequent token charges. |color=#20c400}}
 
== 3DS v2 authentication ==
 
The new more secure 3DS v2 authentication must be conducted for every online card payment. These token payment scenarios also need to use these new secure way of authentication.
The initial payment must be authenticated every time although the subsequent payments may be exempted in certain cases.
 
 
= Technical changes required =
The technical changes depend on what type of token scenario is needed for the business. It is important to notice that these scenarios can be implemented beside each other, a merchant is not required to choose only one type of token payment. The main goal is to appropriately use each scenario.
 
== Technical changes for Recurring payments ==
 
#''' For the token registration''' in the [[Payment-Start-v2|Payment/Start]] request the new properties have to be specified:
#* <code>"RecurrenceType" : "RecurringPayment"</code> to indicate the scenario
#* <code>PurchaseInformation.RecurringExpiry</code> and <code>PurchaseInformation.RecurringFrequency</code> for the limitations <br/><br/>
#Once the callback is received get the response of [[Payment-GetPaymentState-v2|GetPaymentState]]. In case the charge was successful, there will be a <code>TraceId</code> property for the payment. The value of it must be saved and attached to the payment. 
#'''For subsequent payments''' in the [[Payment-Start-v2|Payment/Start]] request specify the
#* <code>"RecurrenceType" : "RecurringPayment"</code>
#* and the <code>TraceId</code> you received for the initial payment.
 
== Technical changes for Merchant initiated payments ==
 
#''' For the token registration''' in the [[Payment-Start-v2|Payment/Start]] request the new property has to be specified:
#* <code>"RecurrenceType" : "MerchantInitiatedPayment"</code> to indicate the scenario
#Once the callback is received get the response of [[Payment-GetPaymentState-v2|GetPaymentState]]. In case the charge was successful, there will be a <code>TraceId</code> property for the payment. The value of it must be saved and attached to the payment. 
#'''For subsequent payments''' in the [[Payment-Start-v2|Payment/Start]] request specify the
#* <code>"RecurrenceType" : "MerchantInitiatedPayment"</code>
#* and the <code>TraceId</code> you received for the initial payment.
 
== Technical changes for One-click payments ==
 
This modification needs the most attention since the merchant has to implement client-side functionality and add a new step at the end of the flow.
 
#''' For the token registration''' in the [[Payment-Start-v2|Payment/Start]] request the new property has to be specified:
#* <code>"RecurrenceType" : "OneClickPayment"</code> to indicate the scenario
#'''For subsequent payments''' the merchant has to integrate the barion.offsitegw.js to be able to authenticate the payer via 3DS v2 on the merchant's site. To do this read the tutorial on [[Token_payment_3D_Secure#OneClick payment|how to integrate this]].
# After a successful authentication a new Barion API endpoint ([[Payment-Complete-v2|/Payment/Complete]]) must be called to finalize the process and charge the card
 
Please notice that in case this scenario is used there is no need to use the <code>TraceId</code> since the 3DS authentication will be performed every time.
 
{{NotificationBox|title=CHANGE|text=In case of one-click token scenario the merchant has to authenticate every card payment with 3DS v2|color=#20c400}}
 
 
== What happens if the merchant doesn't upgrade its implementation ==
 
There will be a two-phase ramp-up period to make sure that integrations can be upgraded.
 
'''Until December 31, 2020'''
 
In this period the integrations that are not up-to-date and are not capable to handle 3DS v2 transactions '''will work'''.
* New tokens can be initiated (without RecurrenceType and TraceId) and the 3DSv2 authentication will be performed by the Barion Smart Gateway.
* Subsequent payments can use existing tokens (RecurrenceId) without specifying the TraceId.
 
 
'''Between January 1 and January 31, 2021 '''
 
In this period the integrations that are not up-to-date and are not capable to handle 3DS v2 transactions '''will work'''. However, to comply with the card scheme mandates Barion has to substitute the missing information.
* New tokens can be initiated (without RecurrenceType and TraceId) and the 3DSv2 authentication will be performed by the Barion Smart Gateway. The payment will be marked as an initial MIT transaction. The MerchantInitiatedPayment RecurrenceType will be used as a fallback.
* Subsequent payments can use existing tokens (RecurrenceId) without specifying the TraceId. They will be handled as the subsequent MIT payment of the initial transaction. The TraceId will be filled in by Barion.
* This period allows all merchants to finish upgrading their integrations, receive TraceIds during subsequent payments, and send it back with the next subsequent payment, so Barion doesn't have to substitute it with a static value anymore.
 
 
'''From February 1, 2021'''
 
Until this date, all integrations must be upgraded.
* New tokens can only be initiated with the appropriate 3DSv2 information (RecurrenceType set). Otherwise, the payment/start will result in a validation error.
* Subsequent payments can use existing tokens (RecurrenceId) without specifying the TraceId. They will be handled as the subsequent MIT payment of the initial transaction. The TraceId will be filled in by Barion. This can be used until the card schemes allow this kind of TraceId substitution.
 
 
{{NotificationBox|title=SUPPORT|text=In case you have difficulties with the upgrade please contact our developers at [email protected] |color=#1993c7}}

Revision as of 20:19, 21 January 2021

Upgrading token payment implementation to comply with 3DS


NOTE
This tutorial was created to help merchants that already have token payment integration with Barion. First, please read through the detailed description of the new token payment with 3DS!

Background

Token payment is a solution that enables the merchant to charge the payer without the presence of them. It is a powerful tool to conduct subscription-like or payer-not-present scenarios. This scenario requires the merchant to create a token that would act as an identifier for the payer's funding source. To attach that token to a valid funding source the merchant had to do several things:

  1. Create an alphanumeric token
  2. Conduct an initial payment in which this token gets registered in the Barion system
  3. Refer to this token in a subsequent payment attempt

This meant that as far as this token referenced a valid (and still available) funding source the merchant could create payments without any limitations. Basically, this token symbolized the funding source. It was up to the merchant to decide what it is used for, neither Barion nor the card issuer was aware of the nature of the subsequent payments.

This funding source can be either a card or an e-money wallet and this is up to the payer to choose. In case the payer chooses to fund the payment from their e-money wallet there is no further need for extra security. On the other hand, when it comes to card payment the authentication process changed with the new Strong Customer Authentication directive and the 3DS v2 protocol.

Changes

To make sure that the payer has more control over these token scenarios and the card issuer knows more about the payment scenarios several things need to be changed.

Token payment scenarios

First of all the merchant has to decide what kind of token payment scenario is suitable. These scenarios are the following:

  • One-click payment: The payer clicks on the "Purchase" button but the charge happens in the background without the payer leaving the merchant's site.
  • Recurring payment: The payer authorizes the merchant (at the initial payment) to charge their card periodically without being present with the same amount.
  • Merchant initiated payment: The payer authorizes the merchant to charge their card without restrictions (eg. amounts can vary).

To decide on a suitable scenario, please read this detailed description

CHANGE
The intended scenario must be specified in the new ReccurenceType property (located in the Payment/Start request)

Usage of TraceId

3DS authentication requires another identifier. This new identifier is used to differentiate these token payment scenarios and help the issuer control what is a non-fraudulent transaction.

So from now on, there will be two IDs for every payer-not-present scenario:

  • RecurrenceId for the funding source: this identifies the source of the money (could be card or wallet)
  • TraceId (new) for the nature of the charge: this identifies the type of token payment scenario the merchant is conducting.

This new TraceId is generated and stored by the card issuer. The Id is available in the GetPaymentState response once the charge is successfully completed.

CHANGE
The TraceId must processed from the GetPaymentState response and must be attached to the payment in merchant's system.

Once the TraceId is acquired it must be sent in the Payment/Start request to identify the scenario. This is crucial for the card transactions otherwise they could be declined.

CHANGE
The TraceId must specified in the Payment/Start for the subsequent token charges.

3DS v2 authentication

The new more secure 3DS v2 authentication must be conducted for every online card payment. These token payment scenarios also need to use these new secure way of authentication. The initial payment must be authenticated every time although the subsequent payments may be exempted in certain cases.


Technical changes required

The technical changes depend on what type of token scenario is needed for the business. It is important to notice that these scenarios can be implemented beside each other, a merchant is not required to choose only one type of token payment. The main goal is to appropriately use each scenario.

Technical changes for Recurring payments

  1. For the token registration in the Payment/Start request the new properties have to be specified:
    • "RecurrenceType" : "RecurringPayment" to indicate the scenario
    • PurchaseInformation.RecurringExpiry and PurchaseInformation.RecurringFrequency for the limitations

  2. Once the callback is received get the response of GetPaymentState. In case the charge was successful, there will be a TraceId property for the payment. The value of it must be saved and attached to the payment.
  3. For subsequent payments in the Payment/Start request specify the
    • "RecurrenceType" : "RecurringPayment"
    • and the TraceId you received for the initial payment.

Technical changes for Merchant initiated payments

  1. For the token registration in the Payment/Start request the new property has to be specified:
    • "RecurrenceType" : "MerchantInitiatedPayment" to indicate the scenario
  2. Once the callback is received get the response of GetPaymentState. In case the charge was successful, there will be a TraceId property for the payment. The value of it must be saved and attached to the payment.
  3. For subsequent payments in the Payment/Start request specify the
    • "RecurrenceType" : "MerchantInitiatedPayment"
    • and the TraceId you received for the initial payment.

Technical changes for One-click payments

This modification needs the most attention since the merchant has to implement client-side functionality and add a new step at the end of the flow.

  1. For the token registration in the Payment/Start request the new property has to be specified:
    • "RecurrenceType" : "OneClickPayment" to indicate the scenario
  2. For subsequent payments the merchant has to integrate the barion.offsitegw.js to be able to authenticate the payer via 3DS v2 on the merchant's site. To do this read the tutorial on how to integrate this.
  3. After a successful authentication a new Barion API endpoint (/Payment/Complete) must be called to finalize the process and charge the card

Please notice that in case this scenario is used there is no need to use the TraceId since the 3DS authentication will be performed every time.

CHANGE
In case of one-click token scenario the merchant has to authenticate every card payment with 3DS v2


What happens if the merchant doesn't upgrade its implementation

There will be a two-phase ramp-up period to make sure that integrations can be upgraded.

Until December 31, 2020

In this period the integrations that are not up-to-date and are not capable to handle 3DS v2 transactions will work.

  • New tokens can be initiated (without RecurrenceType and TraceId) and the 3DSv2 authentication will be performed by the Barion Smart Gateway.
  • Subsequent payments can use existing tokens (RecurrenceId) without specifying the TraceId.


Between January 1 and January 31, 2021

In this period the integrations that are not up-to-date and are not capable to handle 3DS v2 transactions will work. However, to comply with the card scheme mandates Barion has to substitute the missing information.

  • New tokens can be initiated (without RecurrenceType and TraceId) and the 3DSv2 authentication will be performed by the Barion Smart Gateway. The payment will be marked as an initial MIT transaction. The MerchantInitiatedPayment RecurrenceType will be used as a fallback.
  • Subsequent payments can use existing tokens (RecurrenceId) without specifying the TraceId. They will be handled as the subsequent MIT payment of the initial transaction. The TraceId will be filled in by Barion.
  • This period allows all merchants to finish upgrading their integrations, receive TraceIds during subsequent payments, and send it back with the next subsequent payment, so Barion doesn't have to substitute it with a static value anymore.


From February 1, 2021

Until this date, all integrations must be upgraded.

  • New tokens can only be initiated with the appropriate 3DSv2 information (RecurrenceType set). Otherwise, the payment/start will result in a validation error.
  • Subsequent payments can use existing tokens (RecurrenceId) without specifying the TraceId. They will be handled as the subsequent MIT payment of the initial transaction. The TraceId will be filled in by Barion. This can be used until the card schemes allow this kind of TraceId substitution.


SUPPORT
In case you have difficulties with the upgrade please contact our developers at [email protected]