-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblink-open-api-spec.yaml
2232 lines (2196 loc) · 91.8 KB
/
blink-open-api-spec.yaml
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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.0.0
info:
title: Blink Payment v1.0.20
description: Blink Payment API Docs
version: 1.0.0
contact:
name: Blink Payment
email: [email protected]
url: blinkpayment.co.uk
license:
name: MIT License
url: 'https://opensource.org/licenses/MIT'
servers:
- url: 'https://secure.blinkpayment.co.uk'
- url: 'https://gateway2.blinkpayment.co.uk'
tags:
- name: CreditCards
description: 'Operations concerning credit card information, from storing securely to processing transactions.'
- name: DirectDebits
description: 'Provides mechanisms to set up, modify, or cancel direct debit instructions with financial institutions.'
- name: Intents
description: 'Manages user intent processes, enabling the API to understand and respond to user actions.'
- name: OpenBankings
description: 'Integrates with open banking protocols, facilitating access to various banking services and data.'
- name: Paylink
description: 'Enables creation and management of payment links, streamlining the payment process for end-users.'
- name: Tokens
description: 'Handles all operations related to authentication tokens, such as creation, refresh, and validation.'
- name: Transactions
description: 'Offers an interface for transactional data, allowing for tracking, retrieval, and categorization of financial activities.'
paths:
/api/pay/v1/tokens:
post:
tags:
- Tokens
summary: tokens
requestBody:
content:
application/json:
schema:
type: object
x-examples:
Example 1:
api_key: '{{api_key}}'
secret_key: '{{secret_key}}'
payment_api_status: true
send_blink_receipt: true
address_postcode_required: true
enable_moto_payments: true
card_layout: single-line
properties:
api_key:
type: string
description: |
256 alpha numeric, obtained through the Blink platform.
secret_key:
type: string
description: |
256 alpha numeric, obtained through the Blink platform.
payment_api_status:
type: boolean
description: 'To enable payment API , value should be set to true. This field is optional. If not passed, default value is true.'
send_blink_receipt:
type: boolean
description: 'To enable Blink receipt feature after any transaction , value should be set to true. This field is optional. If not passed, default value is false.'
address_postcode_required:
type: boolean
description: 'To fetch address and postcode details of any user for any transaction , value should be set to true. This field is optional. If not passed, default value is false.'
enable_moto_payments:
type: boolean
description: 'To enable MOTO payment feature for any transaction , value should be set to true. This field is optional. If not passed, default value is false.'
required:
- api_key
- secret_key
examples:
Example:
value:
api_key: 49f98f211008be298aaa244...
secret_key: 44b51da04a1ff0caa73afd...
payment_api_status: true
send_blink_receipt: true
address_postcode_required: true
enable_moto_payments: true
application/xml:
schema:
type: object
properties: {}
description: ''
responses:
'200':
description: ''
headers: {}
content:
application/json:
schema:
type: object
x-examples:
Example 1:
access_token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJtZXJjaGFudF9pZCI6NDM5OCwic2VjcmV0X2tleSI6IjYzMTBlNDhiZGQwZTQzODE0NTlhNjJiNDZkMmM0ZmQ2ZThhYjY1YTJhNGQ1MjA1YzZjM2RkZWJmYmJhZWJiZjgiLCJleHAiOjE2OTE1NzYyNDJ9.2x7nhth9SBKN_9rGCXppGO5Soqbf8PvJS_4MEAQP4Kk
expired_on: '2023-08-09T11:17:22Z'
payment_types:
- credit-card
- open-banking
currency: GBP
payment_api_status: true
send_blink_receipt: true
enable_moto_payments: true
address_postcode_required: true
properties:
access_token:
type: string
expired_on:
type: string
payment_types:
type: array
items:
type: string
currency:
type: string
payment_api_status:
type: boolean
send_blink_receipt:
type: boolean
address_postcode_required:
type: boolean
enable_moto_payments:
type: boolean
examples:
Example:
summary: 400 Bad Request
value:
access_token: eyJ0eXAiOiJKV1QiLCJhbG...
expired_on: '2023-01-01T12:00:00Z'
payment_types:
- credit-card
- open-banking
- direct-debit
currency: GBP
payment_api_status: true
send_blink_receipt: true
address_postcode_required: true
enable_moto_payments: true
description: |-
To authenticate requests, the Blink API uses an **api_key** and **secret_key** combination, which is used to obtain an **access_token** for your session.
HTTP Basic Auth is used for authentication. The access_token should be used via bearer in the header to authenticate all requests, e.g. Authentication: Bearer **{{access_token}}**.
Access token is expired after 30 minutes. Then, you need to create a new token.
You can manage and renew your keys on the Blink platform. In case you do not see the keys, simply reach out to support to get set up.
It is essential to keep your API keys secure as they hold significant privileges. Refrain from sharing your secret API keys in public areas such as GitHub, client-side code, etc.
All API requests must be made over HTTPS. Requests made over plain HTTP will be unsuccessful. API requests that lack authentication will also fail.
parameters: []
operationId: tokens
security: []
/api/pay/v1/intents:
post:
tags:
- Intents
summary: Create intent
requestBody:
content:
application/json:
schema:
type: object
x-examples:
Example 1:
amount: '1.1'
transaction_type: SALE
payment_type: credit-card
currency: GBP
return_url: 'https://api-demo-php.blinkpayment.co.uk/return'
notification_url: 'https://api-demo-php.blinkpayment.co.uk/notification'
card_layout: single-line
properties:
amount:
type: number
description: |
Transaction amount.
transaction_type:
type: string
description: |-
Default value is set to SALE. If passed, it can only be one of the following:
- SALE
- VERIFY
- PREAUTH
- CREDIT
payment_type:
type: string
description: |
Can only be one of the following:
- credit-card
- direct-debit
- open-banking
currency:
type: string
description: |
Three letter currency code (ISO 4217) e.g USD, GBP.
return_url:
type: string
description: |
GET URL on your domain, where Blink will redirect after transaction is processed e.g. https://mydomain.com/return.
notification_url:
type: string
description: |
POST URL on your domain, where Blink will send status updates when the transaction status is changed e.g. https://mydomain.com/notification.
card_layout:
type: string
description: |
To get different structure of card layout for any transaction , this parameter is passed. This field is optional. If not passed, default value is basic.
- basic
- single-line
- multi-line
customer_name:
type: string
x-stoplight:
id: rvvuo81dkd5n3
description: |
Customer name.
customer_email:
type: string
x-stoplight:
id: 0h4kouhxylg0q
description: Customer email.
customer_address:
type: string
x-stoplight:
id: 65hfpoeb9o9bc
description: |
Customer address.
customer_postcode:
type: string
x-stoplight:
id: p51yvydmxgcoh
description: |
Customer postcode.
required:
- amount
- transaction_type
- payment_type
- currency
- return_url
- notification_url
examples:
Example:
value:
amount: 1.01
transaction_type: SALE
delay_capture_days: 3
payment_type: credit-card
currency: GBP
return_url: 'https://mydomain.com/return'
notification_url: 'https://mydomain.com/notification'
description: ''
parameters: []
responses:
'201':
description: ''
headers: {}
content:
application/json:
schema:
type: object
properties:
id:
type: integer
payment_intent:
type: string
transaction_type:
type: string
expiry_date:
type: string
amount:
type: number
currency:
type: string
payment_type:
type: string
return_url:
type: string
notification_url:
type: string
card_layout:
type: string
element:
type: object
properties:
ccElement:
type: string
ccMotoElement:
type: string
ddElement:
type: string
obElement:
type: string
merchant_id:
type: integer
transaction_unique:
type: string
examples:
Example:
value:
id: 123
payment_intent: pi_Swhc84aSLtUGppvPARX...
transaction_type: SALE
expiry_date: '2023-04-19T10:19:17Z'
amount: 1.01
currency: GBP
payment_type: credit-card
return_url: 'https://mydomain.com/return'
notification_url: 'https://mydomain.com/notification'
card_layout: single-line
element:
ccElement: |-
<input type="hidden" name="merchantID" value="14456"/>
<input type="hidden" name="payment_intent" value="pi_pqXuNE8rO************************1I2uPcipp1d8qSDTSPIucQyrNNa1UiyBYsBTCffUn9zkGVd3a_94uxXgNb-LD5jaMk"/>
<input type="hidden" name="resource" value="creditcards"/>
<input type="hidden" name="transaction_unique" value="OiXWrlnKvvfh"/>
<input type="text" name="customer_name" value="" placeholder="Name on card" /><br>
<input type="text" name="customer_email" value="" placeholder="Email"/><br><input type="text" placeholder="Address" name="customer_address" value="" /><br>
<input type="text" placeholder="Postcode" name="customer_postcode" value="" /><br><input type="hostedfield:cardNumber" placeholder="1234 1234 1234 1234"/><br>
<input type="hostedfield:cardExpiryDate" placeholder="MM/YY"/><br>
<input type="hostedfield:cardCVV" placeholder="CVV"/><br>
<input type="hidden" id="device_timezone" name="device_timezone" /><br>
<input type="hidden" id="device_capabilities" name="device_capabilities" /><br>
<input type="hidden" id="device_accept_language" name="device_accept_language" /><br>
<input type="hidden" id="device_screen_resolution" name="device_screen_resolution" /><br>
<input type="hidden" id="remote_address" name="remote_address" /><br>
input type="hidden" id="type" name="type" value="1"/><br>
ccMotoElement: |-
<input type="hidden" name="merchantID" value="145671"/>
<input type="hidden" name="payment_intent" value="pi_pqXuNE8rOEmUN0vtQqgf8NnkuQJq4LyOVVz-nz*************************QyrNNa1UiyBYsBTCffUn9zkGVd3a_94uxXgNb-LD5jaMk"/>
<input type="hidden" name="resource" value="creditcards"/>
<input type="hidden" name="transaction_unique" value="OiXWrlnKvvfh"/>
<input type="text" name="customer_name" value="" placeholder="Name on card" /><br>
<input type="text" name="customer_email" value="" placeholder="Email"/><br><input type="text" placeholder="Address" name="customer_address" value="" /><br>
<input type="text" placeholder="Postcode" name="customer_postcode" value="" /><br><input type="hostedfield:cardNumber" placeholder="1234 1234 1234 1234"/><br>
<input type="hostedfield:cardExpiryDate" placeholder="MM/YY"/><br>
<input type="hostedfield:cardCVV" placeholder="CVV"/><br>
<input type="hidden" id="type" name="type" value="2"/><br>
ddElement: |-
<input type="hidden" name="payment_intent" value="pi_pqXuNE8rOEmUN0vtQqgf8NnkuQJq4LyOVVz-nzcR81I2uPcipp1d8qSDTSPIucQyrNNa1UiyBYsBTCffU*******************uxXgNb-LD5jaMk"/>
<input type="hidden" name="transaction_unique" value="OiXWrlnKvvfh"/>
<input type="hidden" name="resource" value="directdebits"/>
<input type="text" placeholder="Given Name" name="given_name"/><br>
<input type="text" placeholder="Family Name" name="family_name"/><br>
<input type="text" placeholder="Company Name" name="company_name"/><br>
<input type="text" placeholder="Email" name="email"/><br><input type="text" placeholder="Address" name="customer_address" value="" /><br>
<input type="text" placeholder="Postcode" name="customer_postcode" value="" /><br><input type="text" placeholder="Account Holder Name" name="account_holder_name"/><br>
<input type="text" placeholder="Branch Code" name="branch_code"/><br>
<input type="text" placeholder="Bank Account Number" name="account_number"/><br>
obElement: |-
<input type="hidden" name="merchant_id" value="140567"/>
<input type="hidden" name="payment_intent" value="pi_pqXuNE8rOEmUN0vtQq*************************d8qSDTSPIucQyrNNa1UiyBYsBTCffUn9zkGVd3a_94uxXgNb-LD5jaMk"/>
<input type="hidden" name="resource" value="openbankings"/>
<input type="hidden" name="transaction_unique" value="OiXWrlnKvvfh"/>
<input type="text" name="user_name" value="" placeholder="Name on card" /><br>
<input type="text" name="user_email" value="" placeholder="Email"/><br><input type="text" placeholder="Address" name="customer_address" value="" /><br>
<input type="text" placeholder="Postcode" name="customer_postcode" value="" /><br>
merchant_id: 134857
transaction_unique: xbKXyWkIL...
description: |-
Authenticate requests using HTTP Basic Auth by adding a bearer token to the header, e.g. Authentication: Bearer **{{access_token}}**. You can get the **{{access_token}}** from the create token request.
Once a payment intent is processed i.e. payment is done using any payment type, it can’t be used again to perform another transaction.Each payment intent can be used for only one payment type.
Please follow the below structure for respective payment form where ccElement or ccMotoElement will be added. Here a custom css file has been added to support different card layout (i.e. single-line and multi-line).
```
<head>
...
<script src="https://secure.blinkpayment.co.uk/assets/css/api.css"></script>
...
</head>
<body>
....
</body>
```
operationId: intents
security:
- Authorization: []
'/api/pay/v1/intents/{intent_id}':
get:
tags:
- Intents
summary: Get intent
parameters:
- name: intent_id
in: path
description: The id of the payment intent
schema:
type: string
required: true
responses:
'200':
description: ''
headers: {}
content:
application/json:
schema:
type: object
properties:
id:
type: integer
payment_intent:
type: string
transaction_type:
type: string
expiry_date:
type: string
status:
type: string
amount:
type: number
currency:
type: string
payment_type:
type: string
return_url:
type: string
notification_url:
type: string
card_layout:
type: string
element:
type: object
properties:
ccElement:
type: string
ccMotoElement:
type: string
ddElement:
type: string
obElement:
type: string
merchant_id:
type: integer
transaction_unique:
type: string
examples:
Example:
value:
id: 123
payment_intent: pi_Swhc84aSLtUGppvPARX...
transaction_type: SALE
expiry_date: '2023-04-19T10:19:17Z'
status: active
amount: 1.01
currency: GBP
payment_type: credit-card
return_url: 'https://mydomain.com/return'
notification_url: 'https://mydomain.com/notification'
card_layout: single-line
element:
ccElement: |-
<input type="hidden" name="merchantID" value="140****"/>
<input type="hidden" name="payment_intent" value="pi_pqXuNE8rOEmUN0vtQqgf*******************8qSDTSPIucQyrNNa1UiyBYsBTCffUn9zkGVd3a_94uxXgNb-LD5jaMk"/>
<input type="hidden" name="resource" value="creditcards"/>
<input type="hidden" name="transaction_unique" value="OiXWrlnKvvfh"/>
<input type="text" name="customer_name" value="" placeholder="Name on card" /><br>
<input type="text" name="customer_email" value="" placeholder="Email"/><br><input type="text" placeholder="Address" name="customer_address" value="" /><br>
<input type="text" placeholder="Postcode" name="customer_postcode" value="" /><br><input type="hostedfield:cardNumber" placeholder="1234 1234 1234 1234"/><br>
<input type="hostedfield:cardExpiryDate" placeholder="MM/YY"/><br>
<input type="hostedfield:cardCVV" placeholder="CVV"/><br>
<input type="hidden" id="device_timezone" name="device_timezone" /><br>
<input type="hidden" id="device_capabilities" name="device_capabilities" /><br>
<input type="hidden" id="device_accept_language" name="device_accept_language" /><br>
<input type="hidden" id="device_screen_resolution" name="device_screen_resolution" /><br>
<input type="hidden" id="remote_address" name="remote_address" /><br>
input type="hidden" id="type" name="type" value="1"/><br>
ccMotoElement: |-
<input type="hidden" name="merchantID" value="146***"/>
<input type="hidden" name="payment_intent" value="pi_pqXuNE8rOEmUN0vtQqgf8NnkuQJq4LyO*********************1d8qSDTSPIucQyrNNa1UiyBYsBTCffUn9zkGVd3a_94uxXgNb-LD5jaMk"/>
<input type="hidden" name="resource" value="creditcards"/>
<input type="hidden" name="transaction_unique" value="OiXWrlnKvvfh"/>
<input type="text" name="customer_name" value="" placeholder="Name on card" /><br>
<input type="text" name="customer_email" value="" placeholder="Email"/><br><input type="text" placeholder="Address" name="customer_address" value="" /><br>
<input type="text" placeholder="Postcode" name="customer_postcode" value="" /><br><input type="hostedfield:cardNumber" placeholder="1234 1234 1234 1234"/><br>
<input type="hostedfield:cardExpiryDate" placeholder="MM/YY"/><br>
<input type="hostedfield:cardCVV" placeholder="CVV"/><br>
<input type="hidden" id="type" name="type" value="2"/><br>
ddElement: |-
<input type="hidden" name="payment_intent" value="pi_pqXu******************************************XgNb-LD5jaMk"/>
<input type="hidden" name="transaction_unique" value="OiXWrlnKvvfh"/>
<input type="hidden" name="resource" value="directdebits"/>
<input type="text" placeholder="Given Name" name="given_name"/><br>
<input type="text" placeholder="Family Name" name="family_name"/><br>
<input type="text" placeholder="Company Name" name="company_name"/><br>
<input type="text" placeholder="Email" name="email"/><br><input type="text" placeholder="Address" name="customer_address" value="" /><br>
<input type="text" placeholder="Postcode" name="customer_postcode" value="" /><br><input type="text" placeholder="Account Holder Name" name="account_holder_name"/><br>
<input type="text" placeholder="Branch Code" name="branch_code"/><br>
<input type="text" placeholder="Bank Account Number" name="account_number"/><br>
obElement: |-
<input type="hidden" name="merchant_id" value="14*****"/>
<input type="hidden" name="payment_intent" value="pi_pqXuNE8rOEmUN0vtQqgf8NnkuQJq4Ly**********************SDTSPIucQyrNNa1UiyBYsBTCffUn9zkGVd3a_94uxXgNb-LD5jaMk"/>
<input type="hidden" name="resource" value="openbankings"/>
<input type="hidden" name="transaction_unique" value="OiXWrlnKvvfh"/>
<input type="text" name="user_name" value="" placeholder="Name on card" /><br>
<input type="text" name="user_email" value="" placeholder="Email"/><br><input type="text" placeholder="Address" name="customer_address" value="" /><br>
<input type="text" placeholder="Postcode" name="customer_postcode" value="" /><br>
merchant_id: 134857
transaction_unique: xbKXyWkIL...
x-stoplight:
id: szt4v5k3c9m9g
description: Get details for a payment intent
operationId: get-intent
security:
- Authorization: []
patch:
tags:
- Intents
summary: Update intent
requestBody:
content:
application/json:
schema:
type: object
properties:
return_url:
type: string
description: Return url.
notification_url:
type: string
description: Notification url.
examples:
Example:
value:
return_url: 'https://mydomain.com/return'
notification_url: 'https://mydomain.com/notification'
description: ''
parameters:
- name: intent_id
in: path
description: Id of the payment intent
schema:
type: string
required: true
responses:
'200':
description: ''
headers: {}
content:
application/json:
schema:
type: object
properties:
id:
type: integer
payment_intent:
type: string
transaction_type:
type: string
expiry_date:
type: string
status:
type: string
amount:
type: number
currency:
type: string
payment_type:
type: string
return_url:
type: string
notification_url:
type: string
card_layout:
type: string
element:
type: object
properties:
ccElement:
type: string
ccMotoElement:
type: string
ddElement:
type: string
obElement:
type: string
merchant_id:
type: integer
transaction_unique:
type: string
examples:
Example:
value:
id: 123
payment_intent: pi_Swhc84aSLtUGppvPARX...
transaction_type: SALE
expiry_date: '2023-04-19T11:19:17Z'
status: active
amount: 1.01
currency: GBP
payment_type: credit-card
return_url: 'https://mydomain.com/return'
notification_url: 'https://mydomain.com/notification'
card_layout: single-line
element:
ccElement: |-
<input type="hidden" name="merchantID" value="1235"/>
<input type="hidden" name="payment_intent" value="pi_pqXuNE8rOEmUN0vtQqgf8NnkuQJq4LyOVVz-nzcR81I2uPcipp1d8qSDTSPIucQyrNNa1UiyBYsBTCffUn9zkGVd3a_94uxXgNb-LD5jaMk"/>
<input type="hidden" name="resource" value="creditcards"/>
<input type="hidden" name="transaction_unique" value="OiXWrlnKvvfh"/>
<input type="text" name="customer_name" value="" placeholder="Name on card" /><br>
<input type="text" name="customer_email" value="" placeholder="Email"/><br><input type="text" placeholder="Address" name="customer_address" value="" /><br>
<input type="text" placeholder="Postcode" name="customer_postcode" value="" /><br><input type="hostedfield:cardNumber" placeholder="1234 1234 1234 1234"/><br>
<input type="hostedfield:cardExpiryDate" placeholder="MM/YY"/><br>
<input type="hostedfield:cardCVV" placeholder="CVV"/><br>
<input type="hidden" id="device_timezone" name="device_timezone" /><br>
<input type="hidden" id="device_capabilities" name="device_capabilities" /><br>
<input type="hidden" id="device_accept_language" name="device_accept_language" /><br>
<input type="hidden" id="device_screen_resolution" name="device_screen_resolution" /><br>
<input type="hidden" id="remote_address" name="remote_address" /><br>
input type="hidden" id="type" name="type" value="1"/><br>
ccMotoElement: |-
<input type="hidden" name="merchantID" value="1235"/>
<input type="hidden" name="payment_intent" value="pi_pqXuNE8rOEmUN0vtQqgf8NnkuQJq4LyOVVz-nzcR81I2uPcipp1d8qSDTSPIucQyrNNa1UiyBYsBTCffUn9zkGVd3a_94uxXgNb-LD5jaMk"/>
<input type="hidden" name="resource" value="creditcards"/>
<input type="hidden" name="transaction_unique" value="OiXWrlnKvvfh"/>
<input type="text" name="customer_name" value="" placeholder="Name on card" /><br>
<input type="text" name="customer_email" value="" placeholder="Email"/><br><input type="text" placeholder="Address" name="customer_address" value="" /><br>
<input type="text" placeholder="Postcode" name="customer_postcode" value="" /><br><input type="hostedfield:cardNumber" placeholder="1234 1234 1234 1234"/><br>
<input type="hostedfield:cardExpiryDate" placeholder="MM/YY"/><br>
<input type="hostedfield:cardCVV" placeholder="CVV"/><br>
<input type="hidden" id="type" name="type" value="2"/><br>
ddElement: |-
<input type="hidden" name="payment_intent" value="pi_pqX************************z-nzcR81I2uPcipp1d8qSDTSPIucQyrNNa1UiyBYsBTCffUn9zkGVd3a_94uxXgNb-LD5jaMk"/>
<input type="hidden" name="transaction_unique" value="OiXWrlnKvvfh"/>
<input type="hidden" name="resource" value="directdebits"/>
<input type="text" placeholder="Given Name" name="given_name"/><br>
<input type="text" placeholder="Family Name" name="family_name"/><br>
<input type="text" placeholder="Company Name" name="company_name"/><br>
<input type="text" placeholder="Email" name="email"/><br><input type="text" placeholder="Address" name="customer_address" value="" /><br>
<input type="text" placeholder="Postcode" name="customer_postcode" value="" /><br><input type="text" placeholder="Account Holder Name" name="account_holder_name"/><br>
<input type="text" placeholder="Branch Code" name="branch_code"/><br>
<input type="text" placeholder="Bank Account Number" name="account_number"/><br>
obElement: |-
<input type="hidden" name="merchant_id" value="1235"/>
<input type="hidden" name="payment_intent" value="pi_pqXuNE8rOEmUN0vtQqgf8NnkuQJq4LyOVVz-nzcR81I2uPcipp1d8qSDTSPIucQyrNNa1UiyBYsBTCffUn9zkGVd3a_94uxXgNb-LD5jaMk"/>
<input type="hidden" name="resource" value="openbankings"/>
<input type="hidden" name="transaction_unique" value="OiXWrlnKvvfh"/>
<input type="text" name="user_name" value="" placeholder="Name on card" /><br>
<input type="text" name="user_email" value="" placeholder="Email"/><br><input type="text" placeholder="Address" name="customer_address" value="" /><br>
<input type="text" placeholder="Postcode" name="customer_postcode" value="" /><br>
merchant_id: 134857
transaction_unique: xbKXyWkIL...
x-stoplight:
id: yc0804wrpr348
description: 'Payment Intent with status as active can only be updated. Once an intent is processed, it can’t be updated.'
operationId: update-intent
security:
- Authorization: []
parameters:
- schema:
type: string
name: intent_id
in: path
required: true
description: The id of the payment intent
/paymentform:
post:
tags:
- CreditCards
summary: Payment page
requestBody:
content:
multipart/form-data:
schema:
type: object
properties:
process:
type: string
example: tokenise
merchantID:
type: string
example: '{{merchant_id}}'
tokenType:
type: string
example: card
'tokenData[cardNumber]':
type: integer
example: 4111111111111111
'tokenData[cardExpiryDate]':
type: string
example: 12/23
'tokenData[cardCVV]':
type: integer
example: 123
responses:
'200':
description: ''
headers: {}
content:
application/json:
schema:
type: object
properties:
success:
type: boolean
message:
type: string
paymentToken:
type: string
cardMask:
type: string
cardInfo:
type: object
properties:
typeCode:
type: string
typeName:
type: string
schemeCode:
type: string
schemeName:
type: string
flags:
type: string
productCode:
type: string
issuer:
type: string
examples:
Example:
value:
success: true
message: Success
paymentToken: eyJwYXltZW50VG9rZW4iOnsibWV0aG9kIjoiY2FyZCIsInJlc291cmNlIjoic3RvcmUiLCJpZCI6MjkyMjE5NX19
cardMask: 411111******1111
cardInfo:
typeCode: VC
typeName: Visa Credit
schemeCode: VC
schemeName: Visa
flags: '4128772'
productCode: '0'
issuer: string
description: |-
To process Credit Card requests, three files must be included in the header section of your payment page. When the submit button is clicked, the three script files automatically trigger a Blink API to tokenize the hosted card fields and generate a payment token. This generated payment token is automatically inserted into the payment form, then the whole form with the payment token is submitted.
In a PHP implementation, your payment page may look like this:
```php
<head>
...
<script src="https://code.jquery.com/jquery-3.6.3.min.js"></script>
<script src="https://gateway2.blinkpayment.co.uk/sdk/web/v1/js/hostedfields.min.js"></script>
<script src="https://secure.blinkpayment.co.uk/assets/js/api/custom.js"></script>
...
</head>
<body>
<form method="POST" action="process" id="payment">
@csrf
{!! $element !!}
<input type="hidden" id="merchant_data" name="merchant_data" value="{\"order_id\": \"12345\"}" />
<button type="submit">Submit</button>
</form>
</body>
```
operationId: payment-page
security:
- Authorization: []
/api/pay/v1/creditcards:
post:
tags:
- CreditCards
summary: Create credit card payment for ECOM
requestBody:
content:
application/json:
schema:
type: object
x-examples:
Example 1:
payment_intent: pi_Swhc84aSLtUGppvPARX...
paymentToken: eyJwYXltZW50VG9rZW4iOns...
type: 1
raw_amount: 1.1
customer_email: [email protected]
customer_name: A Smith
transaction_unique: PHnRNzjUw...
device_timezone: '-330'
device_capabilities: javascript
device_accept_language: en-GB
device_screen_resolution: 1366x768x24
remote_address: 123.123.123.123
merchant_data: '{"my_order_id": "cc-12345678"}'
properties:
payment_intent:
type: string
description: Payment intent token.
paymentToken:
type: string
description: Payment token generated from Create Payment Token request.
type:
type: integer
description: Type 1 is ECOM payment and type 2 is MOTO. Default value is 1 i.e. ECOM.
raw_amount:
type: number
description: |
Payment amount. If not present, it will fetch value from Intent resource.
customer_email:
type: string
description: 'Customer email. If not present, it will fetch value from Intent resource.'
customer_name:
type: string
description: |
Customer name. If not present, it will fetch value from Intent resource.
transaction_unique:
type: string
description: Transaction unique.
device_timezone:
type: string
description: Device timezone value which can be fetched using javascript and assigned to the respective hosted input field. This value is required in 3DS.
device_capabilities:
type: string
description: Device capabilities which can be fetched using javascript and assigned to the respective hosted input field. This value is required in 3DS.
device_accept_language:
type: string
description: Device accept language which can be fetched using javascript and assigned to the respective hosted input field. This value is required in 3DS.
device_screen_resolution:
type: string
description: Device accept language which can be fetched using javascript and assigned to the respective hosted input field. This value is required in 3DS.
remote_address:
type: string
description: Remote address which can be fetched using javascript and assigned to the respective hosted input field. This value is required in 3DS.
merchant_data:
type: object
customer_address:
type: string
x-stoplight:
id: 00b8x0pot2edy
description: 'User’s address details. If not present, it will fetch value from Intent resource.'
customer_postcode:
type: string
x-stoplight:
id: brsv89b8vw0g4
description: 'User’s postcode. If not present, it will fetch value from Intent resource.'
required:
- payment_intent
- paymentToken
- transaction_unique
- device_timezone
- device_capabilities
- device_accept_language
- device_screen_resolution
- remote_address
examples:
Example:
value:
payment_intent: pi_Swhc84aSLtUGppvPARX...
paymentToken: eyJwYXltZW50VG9rZW4iOns...
type: 1
raw_amount: 1.1
customer_email: [email protected]
customer_name: A Smith
transaction_unique: PHnRNzjUw...
device_timezone: '-330'
device_capabilities: javascript
device_accept_language: en-GB
device_screen_resolution: 1366x768x24
remote_address: 123.123.123.123
merchant_data:
my_order_id: cc-12345678
description: ''
parameters: []
responses:
'200':
description: API response
content:
application/json:
schema:
type: object
properties:
acsform:
type: string
x-examples:
Example 1:
acsform: '<form id="form3ds22" method="post" action="https://acs.********"><input type="hidden" name="creq" value="********"> <input type="hidden" name="threeDSPageSessions[427**************][bfreq]" value="*******"> <input type="hidden" name="threeDSPageSessions[427**************][threeDSRef]" value="****"> <input id="btnSubmit" type="submit" class="button expanded btn btn-primary" value="Process Payment"> </form>'
examples:
Example:
value:
acsform: '<form id="form3ds22" method="post" action="https://acs.********"><input type="hidden" name="creq" value="********"> <input type="hidden" name="threeDSPageSessions[427**************][bfreq]" value="*******"> <input type="hidden" name="threeDSPageSessions[427**************][threeDSRef]" value="****"> <input id="btnSubmit" type="submit" class="button expanded btn btn-primary" value="Process Payment"> </form>'
'201':
description: Form submission response
content:
application/json:
schema:
type: object
properties:
url:
type: string
x-examples:
Example 1:
url: 'https://api-demo-php.blinkpayment.co.uk/return?transaction_id=BL-MYU12345&status=captured¬e=Payment%2BSuccessful&merchant_data=%257B%2522order_id%2522%253A%2522cc-12345678%2522%257D'
examples:
'Example ':
value:
url: 'https://api-demo-php.blinkpayment.co.uk/return?transaction_id=BL-MYU12345&status=captured¬e=Payment%2BSuccessful&merchant_data=%257B%2522order_id%2522%253A%2522cc-12345678%2522%257D'
description: |-
ECOM payment is the default type and returns an acsform, which is a HTML from used to perform the 3DS authentication.
A HTML page should be send to the user which include the acsform in the body and the following JS in the header:
```js
<script>
onload = () => document.forms[0].submit();
</script>
```
The user will complete the 3DS form and submit.
After submission, the user will be returned to the predefined return URL with an encoded transaction ID.
An example of your HTML form is below, refer to the payment page doc for further details.
```html
<!DOCTYPE html>
<html>
<head>
<script>
onload = () => document.forms[0].submit();
</script>
</head>
<body>
<form id="form3ds22" method="post" action="https://acs.********"><input type="hidden" name="creq" value="********">
<input type="hidden" name="threeDSPageSessions[427**************][bfreq]" value="*******">
<input type="hidden" name="threeDSPageSessions[427**************][threeDSRef]" value="****">
<input id="btnSubmit" type="submit" class="button expanded btn btn-primary" value="Process Payment">
</form>
</body>
</html>
```
operationId: credit-cards
security:
- Authorization: []
/api/pay/v1/creditcards - copy:
post:
tags:
- CreditCards
summary: Create credit card payment for MOTO
requestBody:
content:
application/json:
schema:
type: object
x-examples:
Example 1:
payment_intent: pi_1A2B3C4D5E6F7G
paymentToken: ptok_1A2B3C4D5E6F7G
type: 1
customer_email: [email protected]
customer_name: John Doe
transaction_unique: trans_1A2B3C4D5E6F7G
merchant_data: '{"order_id": "cc-12345678"}'
device_timezone: '-330'
device_capabilities: javascript
device_accept_language: en-GB
device_screen_resolution: 1366x768x24
remote_address: 123.123.123.123
properties:
payment_intent:
type: string
description: Payment intent token.
paymentToken:
type: string
description: Payment token generated from Create Payment Token request.
type:
type: integer
description: Type 1 is ECOM payment and type 2 is MOTO. Default value is 1 i.e. ECOM.
customer_email:
type: string
description: 'Customer email. If not present, it will fetch value from Intent resource.'
customer_name:
type: string
description: 'Customer name. If not present, it will fetch value from Intent resource.'
customer_address:
type: string
description: 'User’s address details. If not present, it will fetch value from Intent resource.'
customer_postcode:
type: string
description: 'User’s postcode. If not present, it will fetch value from Intent resource.'
transaction_unique:
type: string
description: Transaction unique.
merchant_data:
type: object
description: |-
The merchant can add custom key value pairs in JSON format, for example:
{
"my_order_id": 123,