univapay / univapay-java-sdk

UnivaPay SDK library for Java
1 stars 1 forks source link

Update `supported_brands` #236

Closed andrezimmermann closed 2 years ago

andrezimmermann commented 2 years ago

Add Online and MPM Qr Code brands

Add dynamic_info field

Also add a test to check if doesn't break when dealing with new/unknown brands

andrezimmermann commented 2 years ago

There is a difference between the field naming at the response

  "supported_brands" : [ {
    "online_brand" : "alipay_china",
    "dynamic_info" : true,
    "support_auth_capture" : false,
    "requires_full_name" : false,
    "requires_cvv" : false,
    "countries_allowed" : [ "JP" ],
    "supported_currencies" : [ "JPY" ]
  },{
    "card_brand" : "visa",
    "dynamic_info" : false,
    "support_auth_capture" : false,
    "requires_full_name" : false,
    "requires_cvv" : true,
    "countries_allowed" : [ "JP" ],
    "supported_currencies" : [ "JPY" ]
  },{
    "qr_code" : "alipay_china", <- This is for MPM only, parse as QrMpmBrand
    "dynamic_info" : false,
    "support_auth_capture" : false,
    "requires_full_name" : false,
    "requires_cvv" : true,
    "countries_allowed" : [ "JP" ],
    "supported_currencies" : [ "JPY" ]
  },