In order to consume the Payment's functionality you have to connect the SDK first. You can find more information on how to do that in the Installation section.
The following function retrieves a payment object by Id:
The following function retrieves all payments created:
You can create Fiat Payment by performing the performing the following function:
LimePay.fiatPayment.create(paymentData, signerConfig) // returns new Promise<>.then(payment => {}).catch(error => {});
Object of type Payment is returned, once the promise is resolved.
Where signerConfig
is the wallet configuration of a wallet that is marked as signer
in the Escrow Contract.
You can find more information of the different kinds of signer configurations here.
paymentData
is object with the following properties:
Field | Type | Description | Required |
|
| Currency code (ISO 4217) of the amount to be charged | Yes |
|
| The ID of the shopper that will be charged | Yes |
|
| Array of Item objects | Yes |
|
| Fund Transaction Data object | Yes |
|
| Array of Generic Transaction objects | Yes |
Field | Type | Description | Required |
|
| Amount of ethers that the shopper will be funded with | Yes |
|
| Amount of tokens that the shopper will be funded with | No |
|
| Gas price used when funding shopper. Only applicable for Escrow Version 3 contracts | No |
Field | Type | Description | Required |
|
| Address that the transaction will be send to | Yes |
|
| Gas price of the transaction | Yes |
|
| Gas limit of the transaction | Yes |
|
| Name of the contract's function | Yes |
|
| Array of Function Parameter objects. | No |
limePay.FiatPayments.Create(paymentData types.Payment, privateKey string)// returns (*types.Payment, error)
Returns a pointer to Payment object and an error.
Where paymentData
is object with the following properties:
Field | Type | Description | Required |
|
| Currency code (ISO 4217) of the amount to be charged | Yes |
|
| The ID of the shopper that will be charged | Yes |
|
| Array of Item objects | Yes |
|
| Fund Transaction Data object | Yes |
|
| Array of Generic Transaction objects | Yes |
Field | Type | Description | Required |
|
| Amount of ethers that the shopper will be funded with | Yes |
|
| Amount of tokens that the shopper will be funded with | No |
Field | Type | Description | Required |
|
| Address that the transaction will be send to | Yes |
|
| Gas price of the transaction | Yes |
|
| Gas limit of the transaction | Yes |
|
| Name of the contract's function | Yes |
|
| Array of Function Parameter objects. | No |
You can create Relayed Payment by performing the performing the following function:
LimePay.relayedPayment.create(paymentData, signerConfig) // returns new Promise<>.then(payment => {}).catch(error => {});
Object of type Payment is returned, once the promise is resolved.
Where signerConfig
is the wallet configuration of a wallet the is marked as signer
in the Escrow Contract.
You can find more information of the different kinds of signer configurations here.
paymentData
is object with the following properties:
Field | Type | Description | Required |
|
| The ID of the shopper that will be charged | Yes |
|
| Fund TX Data object | Yes |
|
| Array of Generic Transaction objects | Yes |
Field | Type | Description | Required |
|
| Amount of ethers that the shopper will be funded with | Yes |
|
| Gas price that will be used when funding shopper. Applicable only for Version 3 Escrows | No |
Field | Type | Description | Required |
|
| Address that the transaction will be send to | Yes |
|
| Gas price of the transaction | Yes |
|
| Gas limit of the transaction | Yes |
|
| Name of the contract's function | Yes |
|
| Array of Function Parameter objects. | No |
limePay.RelayedPayments.Create(paymentData types.Payment, privateKey string)// returns (*types.Payment, error)
Returns a pointer to Payment object and an error.
Where paymentData
is object with the following properties:
Field | Type | Description | Required |
|
| Currency code (ISO 4217) of the amount to be charged | Yes |
|
| The ID of the shopper that will be charged | Yes |
|
| Array of Item objects | Yes |
|
| Fund Transaction Data object | Yes |
|
| Array of Generic Transaction objects | Yes |
Field | Type | Description | Required |
|
| Amount of ethers that the shopper will be funded with | Yes |
|
| Amount of tokens that the shopper will be funded with | No |
Field | Type | Description | Required |
|
| Address that the transaction will be send to | Yes |
|
| Gas price of the transaction | Yes |
|
| Gas limit of the transaction | Yes |
|
| Name of the contract's function | Yes |
|
| Array of Function Parameter objects. | No |
By performing the following function, you can retrieve the Invoice that will be send to your customer for a given payment:
LimePay.fiatPayment.getInvoice(paymentId) // returns new Promise<>.then((invoice) => {}).catch(error => {});
String containing the invoice (in HTML format) will be returned, once the promise is resolved.
limePay.FiatPayments.GetInvoice(paymentID string)// returns (string, error)
String containing the invoice (in HTML format) and an error.
You can trigger the sending of an invoice for a given payment by executing the following function:
LimePay.fiatPayment.sendInvoice(paymentId) // returns new Promise<>.then(() => {}).catch(error => {});
limePay.FiatPayments.SendInvoice(paymentID string)// returns error
Returns only an error.
By performing the following function, you can retrieve the Receipt that will be send to your customer for a given payment:
LimePay.fiatPayment.getReceipt(paymentId) // returns new Promise<>.then((receipt) => {}).catch(error => {});
String containing the receipt (in HTML format) will be returned, once the promise is resolved.
limePay.FiatPayments.GetReceipt(paymentID string)// returns (string, error)
String containing the receipt (in HTML format) and an error.
​
​