You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5-237
Original file line number
Diff line number
Diff line change
@@ -2,13 +2,13 @@
2
2
3
3
Helio embedded components can be used in your website for dynamic payments or standard paylinks and pay streams.
4
4
5
-
We currently support React v18.
5
+
## Helio checkout embed
6
6
7
-
Download the NPM from here: https://www.npmjs.com/package/@heliofi/react
7
+
If you would like to embed our Pay Links in your webiste, please see [demo.hel.io](https://demo.hel.io) or our new [Helio Checkout React embed widget](https://www.npmjs.com/package/@heliofi/checkout-react).
8
8
9
-
(Use the latest full version modules for deployment. Do not use the alpha versions unless recommended by Helio)
9
+
Our [sample developer app](https://github.com/heliofi/sample-dev-app) shows how to use our API and embed together.
10
10
11
-
Always use the latest public version and ensure that all your dependencies are on the latest versions
11
+
## Helio SDK
12
12
13
13
The Helio SDK is now integrated into the Helio React modules.
14
14
@@ -24,53 +24,6 @@ Further documents with examples are available here: https://github.com/heliofi/h
24
24
25
25
Devnet and Mainnet are currently supported by Helio.
26
26
27
-
## Installation
28
-
29
-
`yarn add @heliofi/react`
30
-
31
-
## Embed Helio Components
32
-
33
-
You can embed Helio components for the following two use cases:
34
-
35
-
* Embed a Dynamic payment with the Helio Pay button (REACT)
36
-
* Embed a Pay Link or Pay Stream with the Helio Pay button (REACT)
37
-
38
-
### 1. Embed a Dynamic payment with the Helio Pay button
39
-
40
-
The Helio pay button supports a "dynamic" payment options where you can pass a currency and a value through to our standard Helio Pay button.
41
-
This is useful for custom checkout pages that want to have more than one item on the page where a total can be calculated and passed through for payment.
42
-
43
-
In the example below if you provide totalAmount and the currency to the button, the user will perform the payments with those values.
44
-
45
-
```ts
46
-
import { HelioPay } from"@heliofi/react";
47
-
import { SuccessPaymentEvent } from'@heliofi/sdk'
48
-
49
-
const App = () => {
50
-
return (
51
-
<div>
52
-
<HelioPay
53
-
cluster={ClusterHelio.Mainnet}
54
-
paymentRequestId={"your_paylink_id"}
55
-
supportedCurrencies={["SOL"]}
56
-
totalAmount={0.01}
57
-
onSuccess={(event: SuccessPaymentEvent): void=> {
58
-
console.log("onSuccess", event);
59
-
/**
60
-
* The success event signature looks as follows:
61
-
* {
62
-
* content: string;
63
-
* transaction: string;
64
-
* }
65
-
* The transaction can be used to verify the payment with helio api
66
-
* */
67
-
}}
68
-
/>
69
-
</div>
70
-
);
71
-
};
72
-
```
73
-
74
27
### Using the Helio API to verify a dynamic payment
75
28
76
29
Verify the payment using the Helio API by creating access keys here: https://docs.hel.io/developers/helio-api-key
@@ -99,196 +52,11 @@ try {
99
52
thrownewError("Unable to get transactions data from backend!");
100
53
}
101
54
```
102
-
### 2. Embed a Pay Link with the Helio Pay button
103
-
104
-
Use this option if you want to embed the Helio Pay Button on your site for Links
| additionalJSON | object | no || set additional information for customers |
278
-
| customApiUrl | string | no || change api url for all requests |
279
-
280
-
### Support Currencies
56
+
### Supported Currencies
281
57
282
58
Use our Swagger API to get a list of currencies currently supported : https://api.hel.io/v1/docs#/Currency/CurrencyController_value
283
59
284
60
Try it out with currency 'type' of "DIGITAL" to return all supported currencies
285
61
286
62
Or pull directly from : https://api.hel.io/v1/currency?type=DIGITAL
287
-
288
-
### Embedded Example App
289
-
290
-
An example application with dynamic pricing can be found here: [Embedded Example App](https://embed.hel.io/)
291
-
292
-
Repo for the example application which you can review to understand how to embed Helio components : https://github.com/heliofi/heliopay-nextjs-sample
293
-
294
-
<imgwidth="983"alt="Helio Embedded Example App"src="https://user-images.githubusercontent.com/97976151/213204178-1dd385db-00f0-4978-b26c-ba1fefe56d2c.png">
0 commit comments