Payments

Fiat Payments

Loading Fiat Payment

In order for you to initialise the payment form successfully, you will need to load the Fiat Payment.

LimePay.FiatPayments.load(limePayToken) // returns new Promise<>
.then(fiatPayment => {})
.catch(error => {});

Where limePayToken is the token returned after Creating Payment. Returns instance of type Fiat Payment once the promise is resolved.

Processing Fiat Payment

In order to submit the payment for processing one should execute:

fiatPayment.process(cardHolderInformaton, signedTransactions)
.catch(error => {})

Where fiatPayment is instance of Fiat Payment returned from performing:

LimePay.FiatPayments.load(limePayToken);

cardHolderInformaton is object with the following properties:

Attribute

Type

Description

Required

name

string

Name of the shopper that will be billed

Yes

isCompany

boolean

Whether the shopper is a company or not

Yes

countryCode

string

Shopper's ISO, Alpha-2 country code

Yes

zip

string

Shopper's ZIP

Yes

street

string

Shopper's street address

Yes

vatNumber

string

VAT or TAX number of the shopper

No

signedTransactions are the signed transactions that were signed beforehand. More information on how to sign the Ethereum transactions can be found in the Transactions section.

NOTE: Once you've sent the payment for processing successfully, you can monitor its status getting the payment using the SDK.

Calculating VAT/TAX

Fiat Payments have can have VAT/TAX that is applied to them. You can calculate the VAT/TAX for a fiat payment, in order to show it to the customer by:

fiatPayment.calculateVAT(cardHolderData)
.then(vatData => {})
.catch(error => {})

Where fiatPayment is instance of Fiat Payment returned from performing:

LimePay.FiatPayments.load(limePayToken);

and cardHolderData is object with the following properties:

Attribute

Type

Description

Required

countryCode

string

Shopper's ISO, Alpha-2 country code

Yes

isCompany

boolean

Whether the shopper is a company or not

Yes

vatNumber

string

VAT or TAX number of the shopper

No

reducedVatRate

number

The reduced VAT/TAX rate that the shopper can apply for

No

Once the promise is resolved, the returned object is of type:

Attribute

Type

Description

Nullable

rate

number

VAT/TAX percentage that is being applied to the payment

No

totalVAT

number

VAT/TAX amount calculated by rate*paymentAmount + paymentAmount

No

totalAmount

number

This is the total amount for the payment. paymentAmount+totalVAT

No

Relayed Payments

Loading Relayed Payment

In order for you to process a Relayed Payment, you would need to load it by performing the following function:

LimePay.RelayedPayments.load(limePayToken) // returns Promise<>
.then(relayedPayment => {})
.catch(error => {});

Where limePayToken is the token returned after Creating Payment. Returns instance of type Relayed Payment once the promise is resolved.

Processing Relayed Payment

In order to trigger the processing of the relayed payment one should execute:

relayedPayment.process(signedTransactions)
.catch(error => {})

Where relayedPayment is the instance of Relayed Payment returned from performing:

LimePay.RelayedPayments.load()

signedTransactions are the signed transactions that were signed beforehand. More information on how to sign the Ethereum transactions can be found in the Transactions section.

NOTE: Once you've sent the payment for processing successfully, you can monitor its status getting the payment using the SDK.

Related Resources