# 4.4 Supported methods

# 4.4.1 Connect

mycheck.auth.connect({
    publishableKey:'<Ask Shiji for a publishablekey>',
    refreshToken:'<Created using the createRefresh call>'
})

# 4.4.2 Init

mycheck.wallet.init(
    "settings":{
        "locale":"es",//optional-default is en (language code in ISO 639-1) 
            "merchant_id":3877,//required 
            "view":"CHECKOUT"//required - can be either CHECKOUT or MANAGE 
        },
    "payment_details":{ // required when loading with view=CHECKOUT  
        "currency": string, // required 
            "amount": string, // required 
            "return_url": string, // optional - the return URL to be redirected to in case of an instant payment 
            "callback_url": string, // optional -the callback URL to be notified about a an instant payment results 
            "metadata": object // optional - metadata (more information) to be added to the transaction recorded by mycheck - should be an object of a key => value 
        }
    );

# 4.4.3 Get payment method

Return the selected payment method object. In case of 3DS flow you will receive the parameters of encrypted_cvv and fingerprint.

# Attention! Do not manipulate any data within the object, it should be passed to billing as is.

In case of non 3DS payments, you can expect the fields encrypted_cvv and fingerprint to be null.

mycheck.wallet.getPaymentMethod()

Response:

Promise<PaymentMethod>
{
  "cc_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJteWNoZWNrYXBwLmNvbSIsImF1ZCI6IlRFU1QiLCJzdWIiOnsiaWQiOjI2Mjk2LCJzb3VyY2UiOiJCUkFJTlRSRUUiLCJ0b2tlbiI6ImVhN2I4YzljZjJjZjZjODMwZjQ5YTg4MzAzYmUxNWY1YThkZTYyZjNmNGE5NDNlODNhZGJkZjg2ZWE1OGM5YzQifSwiZXhwIjoxNjMxNTU1MzgxLCJpc3N1ZWRfYXQiOjE2MzE1NTUzODEsImtleSI6IjRYV2RPS1NGWnNPUWlydVQifQ.5m5UtZDWrrWG2zYSuMCFrDdvvVwmNFlHWyT0TEQBwiQ",
  "encrypted_cvv": "xxxxxxxxxxxxxxxx",
  "name": "credit card",
  "type": "traditional",
  "fingerprint": {
    "walletSdkSessionId":"16e92971-b80a-46cb-8132-fa481663da4f"
    "ip": "77.124.110.66",
    "screenHeight": 662,
    "timezoneOffset": 788,
    "browserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36" 
  },
  "credit_type": "VI",
  "exp_month": "12",
  "exp_year4": "2030",
  "last_4_digits": 4111,
  "first_6_digits": 411111,
  "source": "MCPCI"
}

# 4.4.4 Set payment details

Sets payment information which is required for Alternative and Instant payment methods for adding a card.

mycheck.wallet.setPaymentDetails({
    "currency": string, // required 
    "amount": string, // required 
    "return_url": string, // the return URL to be redirected to in case of an instant payment 
    "callback_url": string, // the callback URL to be notified about a an instant payment results 
    "metadata": object // metadata (more information) to be added to the transaction recorded by mycheck - should be an object of a key => value 
}) 

Response: Void

# 4.4.5 Make instant payment

Triggers an instant payment (if selected by the user) Its behavior would depend on the Payment Method selected and type of device.

mycheck.wallet.makeInstantPayment()

Response: Void

# 4.4.6 Set accepted credit cards

Sets the accepted cards. It can only narrow down the list configured in the business configuration.

mycheck.wallet.setAcceptedCreditCards(["visa", "amex"])

Response: Void

Supported credit card types

Issuer Set accepted credit cards param Issuer code
Amex amex AX
Union pay unionpay CU
Discover discover DS
JCB jcb JB
Mastercard mastercard MC
Maestro maestro TO
Trip Rewards tr TR
Visa visa VI

# 4.4.7 Set view

Sets the display type of the wallet. There are 2 possible views. “CHECKOUT”, “MANAGE”

mycheck.wallet.setView( view: string)

Response: Void

# 4.4.8 Set locale

Sets the language of the UI of the wallet.

mycheck.wallet.setLocale( language: string)

Response: Void

# 4.4.9 Destroy

Destroys the wallet object.

mycheck.wallet.destroy()

Response: Void