-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstructions.html
87 lines (64 loc) · 2.96 KB
/
instructions.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<!DOCTYPE html>
<html lang="en">
<head>
<title>Wollito Payment Gateway</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
</head>
<body>
<div style="width:90%; margin:auto;">
<h2>Wollito Payment Gateway</h2>
<p>
To install the payment gateway we can use composer.<br/>
<code>composer require wollito/wollito:dev-main</code>
</p>
<div class="install">
After package installation, you need to include the autoload file in your project.
<br>
<code>require_once "vendor/autoload.php";</code>
<br/>
<p>Ensure your composer.json includes the following;</p>
<code>
<pre style="color: #e83e8c;">
"autoload": {
"psr-4": {
"WollitoPackage\\": "vendor/wollito/wollito"
}
}
</pre>
</code>
<h4>Introduction: </h4>
<p>To get start you must instantiate the class, you pass the API Key, API Secret, Description on customers statement, your site url & Currency</p>
<small>Currency options include; GBP, USD, EUR</small>
<br/>
<code>
$wollito = new \WollitoPackage\Wollito("YOUR KEY HERE", "YOUR SECRET KEY HERE", "STATEMENT DESCRIPTOR", "your SITE URL", "CURRENCY (GBP)");
</code>
<br/><br/>
<p>Once you have instantiated the class, you can call function using the <code>$wollito</code> variable.</p>
<h4>Processing Payments:</h4>
<p>The process payment functions, takes the parameters below and can be called like so: </p>
<small>Always include the payment=true parameter.</small>
<code> $data = $wollito->create_charge_link("AMOUNT", "ORDER ID", "Return URL (yoururl.com/returnpage.php?payment=true"); </code>
<p>This will create a charge link where you will redirect user to</p>
<br/><br/>
<h4>Response: </h4>
<p>The call will return a url or false value</p>
<h4>Webhook: </h4>
<p>Sometimes payments are returned as pending and therefore will need updating via a webhook.</p>
<p>Webhook calls are posted to webhook.php, to the originating site URL which made the charge request.</p>
<p>Webhooks can be authenticated with the following call, just pass the <code>$_POST</code> data variable</p>
<code>
$wollito->validate_webhook_call($_POST);
</code>
</div>
<div>
<p>Examples can be found <a href="https://github.com/Wollito/wollito/tree/main/Example">Here</a> </p>
</div>
</div>
</body>
</html>