Download the PHP package aidcoinco/aidpay-php without Composer
On this page you can find all versions of the php package aidcoinco/aidpay-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package aidpay-php
AIDPay for PHP
A PHP wrapper for AIDPay APIs
Official documentation on https://apidoc.aidpay.io
Install
Generate API Key and Secret
Contact AidCoin to have your API Key and Secret here.
Usage
Prepare requirements
Create client
Call APIs
getCharities
Description:
- Returns the list of enabled charities.
Params:
- array with limit (default 12) and offset (default 0)
result:
getCurrencies
Description:
- Returns the list of enabled currencies as a flat array with the associated DAI rate value.
result:
getLimits
Description:
- Returns the min and max amounts of tokens to be exchanged both in DAI and in selected currency.
Params:
- fromCurrency: the currency from which to start the transaction
result:
createDonation
::: warning ONLY FOR NO-PROFIT ACCOUNTS :::
Description:
- Create a donation.
Params:
- orderId: a reference for the customer (i.e. his progressive order id). Will be sent for reference in notifications
- fromCurrency: the currency from which to start the transaction
- invoicedAmount: the amount to convert (in "fromCurrency")
- email: your customer notification email
- itemId: the item id of the charity to send the funds to
- refundAddress: an optional address compatible with "fromCurrency" for receiving refunds in case of problems with the blockchain
- return: the return URL that will be used to redirect your buyers back to your site
result:
The invoicedAmount
will need to be sent to the depositAddress
(by your users or through your system) within 20 minutes.
If you want to use the AidPay interface redirect your users to orderLink
.
createOrder
::: warning ONLY FOR MERCHANT ACCOUNTS :::
Description:
- Create an order.
Params:
- orderId: a reference for the customer (i.e. his progressive order id). Will be sent for reference in notifications
- fromCurrency: the currency from which to start the transaction
- fromFiat: the FIAT currency from which to start the conversion
- fiatAmount: the amount to convert (in "fromFiat")
- email: your customer notification email
- refundAddress: an optional address compatible with "fromCurrency" for receiving refunds in case of problems with the blockchain
- return: the return URL that will be used to redirect your buyers back to your site
result:
The invoicedAmount
will need to be sent to the depositAddress
(by your users or through your system) within 20 minutes.
If you want to use the AidPay interface redirect your users to orderLink
.
getStatus
Description:
- Returns the status of the payment for a given uuid.
Params:
- uuid: the unique id of the payment to search for
::: warning NOTES Status could be
- WAITING_FOR_DEPOSIT
- DEPOSIT_RECEIVED
- DEPOSIT_CONFIRMED
- EXECUTED
- NEEDS_REFUND
- REFUNDED
- CANCELED
- EXPIRED
PaymentStatus could be
- PENDING
- UNDERPAY_RECEIVED
- UNDERPAY_CONFIRMED
- PAYMENT_RECEIVED
- PAYMENT_CONFIRMED
- OVERPAY_RECEIVED
- OVERPAY_CONFIRMED :::
result:
getOrders
Description:
- Returns the customer's order list.
Params:
- array with limit (default 12), offset (default 0) and an optional filters['status']
result:
deletePayment
Description:
- Delete a payment for a given uuid.
Params:
- uuid: the unique id of the payment to search for
result:
Receive Call
When your payment has been EXECUTED
you will receive a POST to the return_url
provided during the setup process.
You should sign the call BODY with your API Secret and then check that it matches our provided sign in HEADERS.
::: warning NOTES This is a Server To Server http call. :::
License
Code released under the MIT License.