CyberSource SDK v1.0.4 CyberSourceSDK.Helper View Source

Small utility functions

Link to this section Summary

Functions

Check what type of payment is: Android Pay or Apple Pay

Convert a Map that have the keys as strings to atoms

Invalid configuration message error

Decode Base64 string to JSON structure

Link to this section Functions

Link to this function

check_payment_type(encrypted_payload) View Source

Check what type of payment is: Android Pay or Apple Pay

Results

  • {:ok, :android_pay}
  • {:ok, :apple_pay}
  • {:error, :not_found}
Link to this function

convert_map_to_key_atom(string_key_map) View Source

Convert a Map that have the keys as strings to atoms

Examples

iex> CyberSourceSDK.Helper.convert_map_to_key_atom(%{"a" => 3, "b" => 5})
%{a: 3, b: 5}
Link to this function

invalid_merchant_configuration() View Source

Invalid configuration message error

Link to this function

json_from_base64(base64_string) View Source

Decode Base64 string to JSON structure

Examples

iex> CyberSourceSDK.Helper.json_from_base64("eyJhIjogMiwgImIiOiAzfQ==")
{:ok, %{a: 2, b: 3}}