Payments

Fiat Payments

Loading Fiat Payment

In order for you to initialise the payment form successfully, you will need to load the Fiat Payment.
1
LimePay.FiatPayments.load(limePayToken) // returns new Promise<>
2
.then(fiatPayment => {})
3
.catch(error => {});
Copied!
Where limePayToken is the token returned after Creating Payment. Returns instance of type Fiat Payment once the promise is resolved.

Signing Transactions

You can sign the transactions through the LimePay Wallet of the user by performing:
1
payment.signWithLimePayWallet(password) // returns new Promise<>
Copied!
NOTE: The example above shows how you can sign transactions for a shopper that uses LimePay Wallets. More information on the other ways you can sign your user's transactions can be found in the Web-Library Documentation.

Processing Fiat Payment

In order to submit the payment for processing one should execute:
1
fiatPayment.process(cardHolderInformaton)
2
.catch(error => {})
Copied!
Where fiatPayment is instance of Fiat Payment returned from performing:
1
LimePay.FiatPayments.load(limePayToken);
Copied!
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
IMPORTANT: You have to sign the transactions for the payment before process.
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:
1
fiatPayment.calculateVAT(cardHolderData)
2
.then(vatData => {})
3
.catch(error => {})
Copied!
Where fiatPayment is instance of Fiat Payment returned from performing:
1
LimePay.FiatPayments.load(limePayToken);
Copied!
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 Relayed payment, you would need to load it by performing the following function:
1
LimePay.RelayedPayments.load(limePayToken) // returns Promise<>
2
.then(relayedPayment => {})
3
.catch(error => {});
Copied!
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:
1
relayedPayment.process() // returns Promise<>
2
.catch(error => {})
Copied!
Where relayedPayment is the instance of Relayed Payment returned from performing:
1
LimePay.RelayedPayments.load()
Copied!
IMPORTANT: You have to sign the transactions for the payment before process.
NOTE: Once you've sent the payment for processing successfully, you can monitor its status getting the payment using the SDK.

Related Resources

Last modified 2yr ago