-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME
196 lines (141 loc) · 5.71 KB
/
README
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
NAME
Business::Giropay - Giropay payments API
VERSION
Version 0.102
DESCRIPTION
Business::Giropay implement's Giropay's GiroCheckout API to make direct
calls to Giropay's payments server.
Giropay facilitates payments via various provider networks in addition
to their own. This module currently supports the following networks:
eps - EPS (Austria)
giropay - Giropay's own network (Germany)
ideal - iDEAL (The Netherlands)
Contributions to allow this module to support other networks available
via Giropay are most welcome.
SYNOPSIS
use Business::Giropay;
my $giropay = Business::Giropay->new(
network => 'giropay',
merchantId => '123456789',
projectId => '1234567',
sandbox => 1,
secret => 'project_secret',
);
my $response = $giropay->transaction(
merchantTxId => 'tx-10928374',
amount => 2938, # 29.38 in cents
currency => 'EUR',
purpose => 'Test Transaction',
bic => 'TESTDETT421',
urlRedirect => 'https://www.example.com/return_page',
urlNotify => 'https://www.example.com/api/giropay/notify',
);
if ( $response->success ) {
# all is good so redirect customer to GiroCheckout
}
else {
# transaction request failed
}
"urlRedirect" and "urlNotify" can also be passed to "new":
use Business::Giropay;
my $giropay = Business::Giropay->new(
network => 'giropay',
merchantId => '123456789',
projectId => '1234567',
urlRedirect => 'https://www.example.com/return_page',
urlNotify => 'https://www.example.com/api/giropay/notify',
sandbox => 1,
secret => 'project_secret',
);
my $response = $giropay->transaction(
merchantTxId => 'tx-10928374',
amount => 2938, # 29.38 in cents
currency => 'EUR',
purpose => 'Test Transaction',
bic => 'TESTDETT421',
);
if ( $response->success ) {
# all is good so redirect customer to GiroCheckout
}
else {
# transaction request failed
}
Elsewhere in your "urlNotify" route:
my $notification = $giropay->notification( %request_params );
if ( $notification->success ) {
# save stuff in DB - customer probably still on bank site
}
else {
# bad stuff happened - make a note of it
}
And in the "urlRedirect" route:
my $notification = $giropay->notification( %request_params );
if ( $notification->success ) {
# we should already have earlier notification but check anyway
# in case customer came back before we received it then thank
# customer for purchase
}
else {
# bad stuff - check out the details and tell the customer
}
ATTRIBUTES
See "ATTRIBUTES" in Business::Giropay::Role::Core for full details of
the following attributes that can be passed to "new".
* network
* merchantId
* projectId
* sandbox
* secret
See "ATTRIBUTES" in Business::Giropay::Role::Urls for full details of
the following attributes that can be passed to "new".
* urlRedirect
* urlNotify
METHODS
NOTE: it is not necessary to pass in any attributes that were already
passed to "new" since they are passed through automatically.
bankstatus %attributes
This API call checks if a bank supports the giropay/eps payment method.
Returns a Business::Giropay::Response::Bankstatus object.
See "ATTRIBUTES" in Business::Giropay::Request::Bankstatus for full
details of the following attribute that can be passed to this method:
* bic
issuer
Returns a Business::Giropay::Response::Issuer object which includes a
list which contains all supported giropay/eps/ideal issuer banks.
transaction %attributes
This API call creates the start of a transaction and returns a
Business::Giropay::Response::Transaction object. If the response
indicates success then customer can be redirected to "redirect" in
Business::Giropay::Response::Transaction to complete payment.
Returns a Business::Giropay::Response::Transaction object.
See "ATTRIBUTES" in Business::Giropay::Request::Transaction for full
details of the following attributes that can be passed to this method:
* merchantTxId
* amount
* currency
* purpose
* bic
* urlRedirect
* urlNotify
notification %query_params
Accepts query parameters and returns a Business::Giropay::Notification
object.
status %attributes
Returns a Business::Giropay::Response::Status object with details of the
requested transaction.
See "ATTRIBUTES" in Business::Giropay::Request::Status for full details
of the following attribute that can be passed to this method:
* reference
SEE ALSO
GiroCheckout API <http://api.girocheckout.de/en:start> which has links
for the various payment network types (giropay, eps, etc). For "status"
see <http://api.girocheckout.de/en:tools:transaction_status>.
TODO
Add more of Giropay's payment networks.
ACKNOWLEDGEMENTS
Many thanks to CALEVO Equestrian <https://www.calevo.com/> for
sponsoring development of this module.
LICENSE AND COPYRIGHT
Copyright 2016 Peter Mottram (SysPete) <[email protected]>
This program is free software; you can redistribute it and/or modify it
under the terms of Perl itself.