hypercharge-schema 1.24.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +7 -0
- data/.travis.yml +6 -0
- data/CHANGELOG.md +3 -0
- data/Gemfile +7 -0
- data/Gemfile.lock +33 -0
- data/LICENSE.txt +22 -0
- data/README.md +73 -0
- data/Rakefile +14 -0
- data/composer.json +17 -0
- data/hypercharge-schema.gemspec +27 -0
- data/json/MobilePayment.json +73 -0
- data/json/WpfPayment.json +99 -0
- data/json/authorize.json +77 -0
- data/json/authorize3d.json +173 -0
- data/json/capture.json +42 -0
- data/json/debit_sale.json +73 -0
- data/json/direct_pay24_sale.json +85 -0
- data/json/giro_pay_sale.json +85 -0
- data/json/ideal_sale.json +87 -0
- data/json/init_recurring_authorize.json +81 -0
- data/json/init_recurring_debit_authorize.json +77 -0
- data/json/init_recurring_debit_sale.json +77 -0
- data/json/init_recurring_sale.json +81 -0
- data/json/pay_in_advance.json +61 -0
- data/json/pay_pal.json +65 -0
- data/json/pay_safe_card_sale.json +69 -0
- data/json/payment_on_delivery.json +57 -0
- data/json/purchase_on_account.json +61 -0
- data/json/reconcile.json +20 -0
- data/json/recurring_debit_sale.json +45 -0
- data/json/recurring_sale.json +45 -0
- data/json/referenced_fund_transfer.json +46 -0
- data/json/refund.json +42 -0
- data/json/sale.json +77 -0
- data/json/sale3d.json +173 -0
- data/json/scheduler_create.json +46 -0
- data/json/scheduler_index.json +34 -0
- data/json/scheduler_update.json +35 -0
- data/json/types.json +385 -0
- data/json/void.json +33 -0
- data/lib/php/JsonSchemaFixture.php +12 -0
- data/lib/php/JsonSchemaValidator.php +47 -0
- data/lib/ruby/hypercharge/schema.rb +31 -0
- data/lib/ruby/hypercharge/schema/fixture.rb +30 -0
- data/lib/ruby/hypercharge/schema/version.rb +7 -0
- data/package.json +27 -0
- data/test/fixtures/notifications/PaymentNotification_echo.xml +4 -0
- data/test/fixtures/notifications/TransactionNotification_echo.xml +4 -0
- data/test/fixtures/notifications/recurring_event.json +13 -0
- data/test/fixtures/notifications/scheduler.json +7 -0
- data/test/fixtures/requests/MobilePayment.json +35 -0
- data/test/fixtures/requests/MobilePayment.xml +34 -0
- data/test/fixtures/requests/WpfPayment.json +40 -0
- data/test/fixtures/requests/WpfPayment.xml +39 -0
- data/test/fixtures/requests/WpfPayment_cancel.xml +4 -0
- data/test/fixtures/requests/WpfPayment_capture.xml +4 -0
- data/test/fixtures/requests/WpfPayment_refund.xml +4 -0
- data/test/fixtures/requests/WpfPayment_void.xml +4 -0
- data/test/fixtures/requests/authorize.json +29 -0
- data/test/fixtures/requests/authorize.xml +28 -0
- data/test/fixtures/requests/authorize3d_async.json +32 -0
- data/test/fixtures/requests/authorize3d_async.xml +31 -0
- data/test/fixtures/requests/authorize3d_sync.json +34 -0
- data/test/fixtures/requests/authorize3d_sync.xml +33 -0
- data/test/fixtures/requests/capture.json +10 -0
- data/test/fixtures/requests/capture.xml +9 -0
- data/test/fixtures/requests/debit_sale.json +28 -0
- data/test/fixtures/requests/debit_sale.xml +27 -0
- data/test/fixtures/requests/direct_pay24_sale.json +31 -0
- data/test/fixtures/requests/direct_pay24_sale.xml +30 -0
- data/test/fixtures/requests/giro_pay_sale.json +31 -0
- data/test/fixtures/requests/giro_pay_sale.xml +30 -0
- data/test/fixtures/requests/ideal_sale.json +31 -0
- data/test/fixtures/requests/ideal_sale.xml +30 -0
- data/test/fixtures/requests/init_recurring_authorize.json +34 -0
- data/test/fixtures/requests/init_recurring_authorize.xml +33 -0
- data/test/fixtures/requests/init_recurring_debit_authorize.json +33 -0
- data/test/fixtures/requests/init_recurring_debit_authorize.xml +32 -0
- data/test/fixtures/requests/init_recurring_debit_sale.json +34 -0
- data/test/fixtures/requests/init_recurring_debit_sale.xml +32 -0
- data/test/fixtures/requests/init_recurring_sale.json +34 -0
- data/test/fixtures/requests/init_recurring_sale.xml +33 -0
- data/test/fixtures/requests/init_recurring_sale_with_recurring_schedule.json +34 -0
- data/test/fixtures/requests/pay_in_advance.json +24 -0
- data/test/fixtures/requests/pay_in_advance.xml +23 -0
- data/test/fixtures/requests/pay_pal.json +23 -0
- data/test/fixtures/requests/pay_pal.xml +22 -0
- data/test/fixtures/requests/pay_safe_card_sale.json +23 -0
- data/test/fixtures/requests/pay_safe_card_sale.xml +23 -0
- data/test/fixtures/requests/payment_on_delivery.json +24 -0
- data/test/fixtures/requests/payment_on_delivery.xml +23 -0
- data/test/fixtures/requests/purchase_on_account.json +26 -0
- data/test/fixtures/requests/purchase_on_account.xml +23 -0
- data/test/fixtures/requests/reconcile.json +5 -0
- data/test/fixtures/requests/reconcile.xml +4 -0
- data/test/fixtures/requests/reconcile_by_date.json +7 -0
- data/test/fixtures/requests/reconcile_by_date.xml +6 -0
- data/test/fixtures/requests/recurring_debit_sale.json +11 -0
- data/test/fixtures/requests/recurring_debit_sale.xml +10 -0
- data/test/fixtures/requests/recurring_event.xml +4 -0
- data/test/fixtures/requests/recurring_sale.json +11 -0
- data/test/fixtures/requests/recurring_sale.xml +10 -0
- data/test/fixtures/requests/referenced_fund_transfer.json +11 -0
- data/test/fixtures/requests/referenced_fund_transfer.xml +10 -0
- data/test/fixtures/requests/refund.json +10 -0
- data/test/fixtures/requests/refund.xml +9 -0
- data/test/fixtures/requests/risk_params.json +10 -0
- data/test/fixtures/requests/risk_params.xml +9 -0
- data/test/fixtures/requests/sale.json +29 -0
- data/test/fixtures/requests/sale.xml +28 -0
- data/test/fixtures/requests/sale3d_async.json +32 -0
- data/test/fixtures/requests/sale3d_async.xml +31 -0
- data/test/fixtures/requests/sale3d_sync.json +34 -0
- data/test/fixtures/requests/sale3d_sync.xml +33 -0
- data/test/fixtures/requests/scheduler_create.json +9 -0
- data/test/fixtures/requests/scheduler_index_get_params.json +9 -0
- data/test/fixtures/requests/scheduler_update.json +8 -0
- data/test/fixtures/requests/void.json +8 -0
- data/test/fixtures/requests/void.xml +7 -0
- data/test/fixtures/responses/MobilePayment_new.json +20 -0
- data/test/fixtures/responses/MobilePayment_new.xml +19 -0
- data/test/fixtures/responses/PaymentNotification_echo.xml +4 -0
- data/test/fixtures/responses/PaymentTransactionNotification_echo.xml +4 -0
- data/test/fixtures/responses/WpfPayment_cancel.xml +13 -0
- data/test/fixtures/responses/WpfPayment_captured.xml +39 -0
- data/test/fixtures/responses/WpfPayment_error.json +8 -0
- data/test/fixtures/responses/WpfPayment_error.xml +7 -0
- data/test/fixtures/responses/WpfPayment_find.xml +39 -0
- data/test/fixtures/responses/WpfPayment_new.json +16 -0
- data/test/fixtures/responses/WpfPayment_new.xml +17 -0
- data/test/fixtures/responses/WpfPayment_refunded.xml +39 -0
- data/test/fixtures/responses/WpfPayment_voided.xml +39 -0
- data/test/fixtures/responses/authorize3d_pending_async.xml +15 -0
- data/test/fixtures/responses/authorize3d_sync.xml +14 -0
- data/test/fixtures/responses/authorize_approved.xml +14 -0
- data/test/fixtures/responses/authorize_error.json +16 -0
- data/test/fixtures/responses/authorize_error.xml +15 -0
- data/test/fixtures/responses/capture.xml +14 -0
- data/test/fixtures/responses/create_chargeback.xml +12 -0
- data/test/fixtures/responses/create_chargeback_reversal.xml +12 -0
- data/test/fixtures/responses/create_charged_debit_sale.xml +12 -0
- data/test/fixtures/responses/create_debit_chargeback.xml +12 -0
- data/test/fixtures/responses/create_deposit.xml +12 -0
- data/test/fixtures/responses/create_pre_arbitration.xml +12 -0
- data/test/fixtures/responses/create_rejected_debit_sale.xml +12 -0
- data/test/fixtures/responses/create_retrieval_request.xml +12 -0
- data/test/fixtures/responses/debit_sale.xml +12 -0
- data/test/fixtures/responses/direct_pay24_sale.xml +15 -0
- data/test/fixtures/responses/giro_pay_sale.xml +15 -0
- data/test/fixtures/responses/ideal_sale.xml +17 -0
- data/test/fixtures/responses/init_recurring_authorize.xml +14 -0
- data/test/fixtures/responses/init_recurring_debit_authorize.xml +17 -0
- data/test/fixtures/responses/init_recurring_debit_sale.xml +17 -0
- data/test/fixtures/responses/init_recurring_sale.xml +14 -0
- data/test/fixtures/responses/pay_in_advance.xml +17 -0
- data/test/fixtures/responses/pay_pal.xml +15 -0
- data/test/fixtures/responses/pay_safe_card_sale.xml +15 -0
- data/test/fixtures/responses/payment_on_delivery.xml +14 -0
- data/test/fixtures/responses/purchase_on_account.xml +18 -0
- data/test/fixtures/responses/reconcile_by_date_empty_result.xml +3 -0
- data/test/fixtures/responses/reconcile_by_date_page_1.xml +1293 -0
- data/test/fixtures/responses/reconcile_by_date_page_2.xml +1346 -0
- data/test/fixtures/responses/reconcile_by_date_page_3.xml +1394 -0
- data/test/fixtures/responses/reconcile_by_date_single_result.xml +16 -0
- data/test/fixtures/responses/recurring_debit_sale.xml +16 -0
- data/test/fixtures/responses/recurring_event.json +22 -0
- data/test/fixtures/responses/recurring_event.xml +21 -0
- data/test/fixtures/responses/recurring_sale.xml +14 -0
- data/test/fixtures/responses/referenced_fund_transfer.xml +14 -0
- data/test/fixtures/responses/refund.xml +14 -0
- data/test/fixtures/responses/sale.xml +12 -0
- data/test/fixtures/responses/sale3d_async.xml +15 -0
- data/test/fixtures/responses/sale3d_sync.xml +14 -0
- data/test/fixtures/responses/scheduled_transactions_empty.json +8 -0
- data/test/fixtures/responses/scheduled_transactions_one.json +22 -0
- data/test/fixtures/responses/scheduler.json +12 -0
- data/test/fixtures/responses/scheduler_empty_result.json +8 -0
- data/test/fixtures/responses/scheduler_error.json +7 -0
- data/test/fixtures/responses/scheduler_next.json +4 -0
- data/test/fixtures/responses/scheduler_page_1.json +93 -0
- data/test/fixtures/responses/scheduler_page_2.json +45 -0
- data/test/fixtures/responses/scheduler_single_result.json +21 -0
- data/test/fixtures/responses/void.xml +12 -0
- data/test/js/mobile_payment_test.js +287 -0
- data/test/php/all.php +9 -0
- data/test/php/authorize3d_test.php +546 -0
- data/test/php/authorize_test.php +546 -0
- data/test/php/capture_test.php +241 -0
- data/test/php/json_schema_validator_test.php +24 -0
- data/test/php/mobile_payment_test.php +238 -0
- data/test/php/reconcile_test.php +21 -0
- data/test/php/referenced_fund_transfer_test.php +183 -0
- data/test/php/refund_test.php +237 -0
- data/test/php/sale_test.php +546 -0
- data/test/php/test_helper.php +29 -0
- data/test/php/void_test.php +163 -0
- data/test/php/wpf_payment_test.php +19 -0
- data/test/ruby/authorize3d_async_spec.rb +29 -0
- data/test/ruby/authorize3d_sync_spec.rb +27 -0
- data/test/ruby/authorize_spec.rb +25 -0
- data/test/ruby/capture_spec.rb +16 -0
- data/test/ruby/debit_sale_spec.rb +26 -0
- data/test/ruby/direct_pay24_sale_spec.rb +30 -0
- data/test/ruby/giro_pay_sale_spec.rb +30 -0
- data/test/ruby/ideal_sale_spec.rb +29 -0
- data/test/ruby/init_recurring_authorize_spec.rb +26 -0
- data/test/ruby/init_recurring_debit_authorize_spec.rb +27 -0
- data/test/ruby/init_recurring_debit_sale_spec.rb +27 -0
- data/test/ruby/init_recurring_sale_spec.rb +26 -0
- data/test/ruby/mobile_payment_spec.rb +22 -0
- data/test/ruby/pay_in_advance_spec.rb +23 -0
- data/test/ruby/pay_pal_spec.rb +25 -0
- data/test/ruby/pay_safe_card_sale_spec.rb +24 -0
- data/test/ruby/payment_on_delivery_spec.rb +21 -0
- data/test/ruby/purchase_on_account_spec.rb +23 -0
- data/test/ruby/reconcile_spec.rb +11 -0
- data/test/ruby/recurring_debit_sale_spec.rb +17 -0
- data/test/ruby/recurring_sale_spec.rb +17 -0
- data/test/ruby/referenced_fund_transfer_spec.rb +17 -0
- data/test/ruby/refund_spec.rb +16 -0
- data/test/ruby/sale3d_async_spec.rb +29 -0
- data/test/ruby/sale3d_sync_spec.rb +27 -0
- data/test/ruby/sale_spec.rb +25 -0
- data/test/ruby/scheduler_spec.rb +43 -0
- data/test/ruby/test_helper.rb +74 -0
- data/test/ruby/types_specs.rb +1494 -0
- data/test/ruby/void_spec.rb +14 -0
- data/test/ruby/wpf_payment_spec.rb +27 -0
- metadata +527 -0
@@ -0,0 +1,29 @@
|
|
1
|
+
<?php
|
2
|
+
require_once dirname(dirname(__DIR__)).'/vendor/autoload.php';
|
3
|
+
require_once dirname(dirname(__DIR__)).'/vendor/vierbergenlars/simpletest/autorun.php';
|
4
|
+
|
5
|
+
class SchemaTestCase extends UnitTestCase {
|
6
|
+
|
7
|
+
function __construct($schemaName=null) {
|
8
|
+
parent::__construct();
|
9
|
+
if(!isset($schemaName)) return;
|
10
|
+
|
11
|
+
$this->validator = new \Hypercharge\JsonSchemaValidator($schemaName);
|
12
|
+
}
|
13
|
+
|
14
|
+
function fixture($file) {
|
15
|
+
return file_get_contents(dirname(__DIR__).'/fixtures/requests/'. $file);
|
16
|
+
}
|
17
|
+
|
18
|
+
function assertValid($data = null) {
|
19
|
+
if($data === null) $data = $this->data;
|
20
|
+
$errors = $this->validator->check($data);
|
21
|
+
$this->assertFalse($errors, "unexpected validation errors:\n".print_r($errors, true));
|
22
|
+
}
|
23
|
+
|
24
|
+
function assertNotValid($data = null) {
|
25
|
+
if($data === null) $data = $this->data;
|
26
|
+
$errors = $this->validator->check($data);
|
27
|
+
$this->assertIsA($errors, 'array', "data should not be valid:\n".print_r($data, true));
|
28
|
+
}
|
29
|
+
}
|
@@ -0,0 +1,163 @@
|
|
1
|
+
<?php
|
2
|
+
require_once 'test_helper.php';
|
3
|
+
|
4
|
+
class void_Test extends SchemaTestCase {
|
5
|
+
|
6
|
+
function __construct() {
|
7
|
+
parent::__construct('void');
|
8
|
+
$this->jsonData = $this->fixture('void.json');
|
9
|
+
}
|
10
|
+
|
11
|
+
function setUp() {
|
12
|
+
$this->data = json_decode($this->jsonData);
|
13
|
+
$this->trx = $this->data->payment_transaction;
|
14
|
+
}
|
15
|
+
|
16
|
+
function testFixtureShouldValidate() {
|
17
|
+
$this->assertValid();
|
18
|
+
$this->assertEqual('void', $this->trx->transaction_type);
|
19
|
+
}
|
20
|
+
|
21
|
+
function testObjectRequired() {
|
22
|
+
$this->data = null;
|
23
|
+
$this->assertNotValid();
|
24
|
+
}
|
25
|
+
|
26
|
+
function testRootNodeRequired() {
|
27
|
+
$this->data = new stdClass;
|
28
|
+
$this->assertNotValid();
|
29
|
+
}
|
30
|
+
|
31
|
+
function testRootNodeContentsRequired() {
|
32
|
+
$this->data->payment_transaction = new stdClass;
|
33
|
+
$this->assertNotValid();
|
34
|
+
}
|
35
|
+
|
36
|
+
function testNoAdditionalFieldsAllowedInRoot() {
|
37
|
+
$this->data->should_cause_validation_error = 'foo';
|
38
|
+
$this->assertNotValid();
|
39
|
+
}
|
40
|
+
|
41
|
+
function testNoAdditionalFieldsAllowedInTrx() {
|
42
|
+
$this->trx->should_cause_validation_error = 'foo';
|
43
|
+
$this->assertNotValid();
|
44
|
+
}
|
45
|
+
|
46
|
+
function testTypeWrong() {
|
47
|
+
$this->trx->transaction_type = 'refund';
|
48
|
+
$this->assertNotValid();
|
49
|
+
}
|
50
|
+
|
51
|
+
function testTransactionId1Char() {
|
52
|
+
$this->trx->transaction_id = 'a';
|
53
|
+
$this->assertValid();
|
54
|
+
}
|
55
|
+
|
56
|
+
function testTransactionId255Char() {
|
57
|
+
$this->trx->transaction_id = str_repeat('x', 255);
|
58
|
+
$this->assertValid();
|
59
|
+
}
|
60
|
+
|
61
|
+
function testTransactionIdValidChars() {
|
62
|
+
$this->trx->transaction_id = 'abcxyzABCDXYZ0123456789-_.';
|
63
|
+
$this->assertValid();
|
64
|
+
}
|
65
|
+
|
66
|
+
function testTransactionIdSlashShouldBeInvalid() {
|
67
|
+
$this->trx->transaction_id = '/';
|
68
|
+
$this->assertNotValid();
|
69
|
+
}
|
70
|
+
|
71
|
+
function testTransactionId256CharShouldBeInvalid() {
|
72
|
+
$this->trx->transaction_id = str_repeat('a', 256);
|
73
|
+
$this->assertNotValid();
|
74
|
+
}
|
75
|
+
|
76
|
+
function testTransactionIdBackslashShouldBeInvalid() {
|
77
|
+
$this->trx->transaction_id = '\\';
|
78
|
+
$this->assertNotValid();
|
79
|
+
}
|
80
|
+
|
81
|
+
function testTransactionIdPlusShouldBeInvalid() {
|
82
|
+
$this->trx->transaction_id = '+';
|
83
|
+
$this->assertNotValid();
|
84
|
+
}
|
85
|
+
|
86
|
+
function testTransactionIdStarShouldBeInvalid() {
|
87
|
+
$this->trx->transaction_id = '*';
|
88
|
+
$this->assertNotValid();
|
89
|
+
}
|
90
|
+
|
91
|
+
function testTransactionIdEmpty() {
|
92
|
+
$this->trx->transaction_id = '';
|
93
|
+
$this->assertNotValid();
|
94
|
+
}
|
95
|
+
|
96
|
+
function testUsage1Char() {
|
97
|
+
$this->trx->usage = 'x';
|
98
|
+
$this->assertValid();
|
99
|
+
}
|
100
|
+
function testUsage255Char() {
|
101
|
+
$this->trx->usage = str_repeat('_', 255);
|
102
|
+
$this->assertValid();
|
103
|
+
}
|
104
|
+
function testUsageEmpty() {
|
105
|
+
$this->trx->usage = '';
|
106
|
+
$this->assertNotValid();
|
107
|
+
}
|
108
|
+
function testUsage256Char() {
|
109
|
+
$this->trx->usage = str_repeat('_', 256);
|
110
|
+
$this->assertNotValid();
|
111
|
+
}
|
112
|
+
function testUsageValidChars() {
|
113
|
+
$this->trx->usage = "aAÄöéß1234 - _ / # '\" <b>";
|
114
|
+
$this->assertValid();
|
115
|
+
}
|
116
|
+
function testUsageMissing() {
|
117
|
+
unset($this->trx->usage);
|
118
|
+
$this->assertValid();
|
119
|
+
}
|
120
|
+
|
121
|
+
function testRemoteIp_127_0_0_1() {
|
122
|
+
$this->trx->remote_ip = "127.0.0.1";
|
123
|
+
$this->assertNotValid();
|
124
|
+
}
|
125
|
+
function testRemoteIpMissing() {
|
126
|
+
unset($this->trx->remote_ip);
|
127
|
+
$this->assertValid();
|
128
|
+
}
|
129
|
+
|
130
|
+
function testRefenrenceIdRequired() {
|
131
|
+
unset($this->trx->reference_id);
|
132
|
+
$this->assertNotValid();
|
133
|
+
}
|
134
|
+
function testRefenrenceIdEmpty() {
|
135
|
+
$this->trx->reference_id = '';
|
136
|
+
$this->assertNotValid();
|
137
|
+
}
|
138
|
+
function testRefenrenceIdBlank() {
|
139
|
+
$this->trx->reference_id = str_repeat(' ', 32);
|
140
|
+
$this->assertNotValid();
|
141
|
+
}
|
142
|
+
function testRefenrenceId_31_chars() {
|
143
|
+
$this->trx->reference_id = str_repeat('a', 31);
|
144
|
+
$this->assertNotValid();
|
145
|
+
}
|
146
|
+
function testRefenrenceId_32_chars() {
|
147
|
+
$this->trx->reference_id = str_repeat('a', 32);
|
148
|
+
$this->assertValid();
|
149
|
+
}
|
150
|
+
function testRefenrenceId_33_chars() {
|
151
|
+
$this->trx->reference_id = str_repeat('a', 33);
|
152
|
+
$this->assertNotValid();
|
153
|
+
}
|
154
|
+
function testRefenrenceId_255_chars() {
|
155
|
+
$this->trx->reference_id = str_repeat('a', 256);
|
156
|
+
$this->assertNotValid();
|
157
|
+
}
|
158
|
+
|
159
|
+
function testRiskParamsNotAllowed() {
|
160
|
+
$this->trx->risk_params = json_decode($this->fixture('risk_params.json'));
|
161
|
+
$this->assertNotValid();
|
162
|
+
}
|
163
|
+
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<?php
|
2
|
+
require_once 'test_helper.php';
|
3
|
+
|
4
|
+
class WpfPaymentTest extends SchemaTestCase {
|
5
|
+
|
6
|
+
function __construct() {
|
7
|
+
parent::__construct('WpfPayment');
|
8
|
+
$this->jsonData = $this->fixture('WpfPayment.json');
|
9
|
+
}
|
10
|
+
|
11
|
+
function setUp() {
|
12
|
+
$this->data = json_decode($this->jsonData);
|
13
|
+
$this->payment = $this->data->payment;
|
14
|
+
}
|
15
|
+
|
16
|
+
function testFixtureShouldValidate() {
|
17
|
+
$this->assertValid();
|
18
|
+
}
|
19
|
+
}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
|
4
|
+
describe 'Authorize3d Async JSON Schema' do
|
5
|
+
let(:schema_path){ schema_path_for('authorize3d') }
|
6
|
+
subject{ fixture('authorize3d_async') }
|
7
|
+
let(:root_key){ subject.keys.first }
|
8
|
+
|
9
|
+
root_wont_allow_additional_properties
|
10
|
+
spec_attribute 'transaction_type', value: 'authorize3d'
|
11
|
+
spec_attribute 'transaction_id'
|
12
|
+
spec_attribute 'usage'
|
13
|
+
spec_attribute 'remote_ip', required: true
|
14
|
+
spec_attribute 'amount'
|
15
|
+
spec_attribute 'currency'
|
16
|
+
spec_attribute 'card_holder'
|
17
|
+
spec_attribute 'card_number'
|
18
|
+
spec_attribute 'cvv'
|
19
|
+
spec_attribute 'expiration_month'
|
20
|
+
spec_attribute 'expiration_year'
|
21
|
+
spec_attribute 'customer_email', required: true
|
22
|
+
spec_attribute 'customer_phone'
|
23
|
+
spec_attribute 'billing_address', required: true
|
24
|
+
spec_attribute 'risk_params'
|
25
|
+
|
26
|
+
spec_attribute 'notification_url', spec: 'url'
|
27
|
+
spec_attribute 'return_success_url', spec: 'url'
|
28
|
+
spec_attribute 'return_failure_url', spec: 'url'
|
29
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
|
4
|
+
describe 'Authorize3d Sync JSON Schema' do
|
5
|
+
let(:schema_path){ schema_path_for('authorize3d') }
|
6
|
+
subject{ fixture('authorize3d_sync') }
|
7
|
+
let(:root_key){ subject.keys.first }
|
8
|
+
|
9
|
+
root_wont_allow_additional_properties
|
10
|
+
spec_attribute 'transaction_type', value: 'authorize3d'
|
11
|
+
spec_attribute 'transaction_id'
|
12
|
+
spec_attribute 'usage'
|
13
|
+
spec_attribute 'remote_ip', required: true
|
14
|
+
spec_attribute 'amount'
|
15
|
+
spec_attribute 'currency'
|
16
|
+
spec_attribute 'card_holder'
|
17
|
+
spec_attribute 'card_number'
|
18
|
+
spec_attribute 'cvv'
|
19
|
+
spec_attribute 'expiration_month'
|
20
|
+
spec_attribute 'expiration_year'
|
21
|
+
spec_attribute 'customer_email', required: true
|
22
|
+
spec_attribute 'customer_phone'
|
23
|
+
spec_attribute 'billing_address', required: true
|
24
|
+
spec_attribute 'risk_params'
|
25
|
+
|
26
|
+
spec_attribute 'mpi_params'
|
27
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
|
4
|
+
describe 'Authorize JSON Schema' do
|
5
|
+
let(:schema_path){ schema_path_for('authorize') }
|
6
|
+
subject{ fixture('authorize') }
|
7
|
+
let(:root_key){ subject.keys.first }
|
8
|
+
|
9
|
+
root_wont_allow_additional_properties
|
10
|
+
spec_attribute 'transaction_type', value: 'authorize'
|
11
|
+
spec_attribute 'transaction_id'
|
12
|
+
spec_attribute 'usage'
|
13
|
+
spec_attribute 'remote_ip', required: true
|
14
|
+
spec_attribute 'amount'
|
15
|
+
spec_attribute 'currency'
|
16
|
+
spec_attribute 'card_holder'
|
17
|
+
spec_attribute 'card_number'
|
18
|
+
spec_attribute 'cvv'
|
19
|
+
spec_attribute 'expiration_month'
|
20
|
+
spec_attribute 'expiration_year'
|
21
|
+
spec_attribute 'customer_email', required: true
|
22
|
+
spec_attribute 'customer_phone'
|
23
|
+
spec_attribute 'billing_address', required: true
|
24
|
+
spec_attribute 'risk_params'
|
25
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
|
4
|
+
describe 'Capture JSON Schema' do
|
5
|
+
let(:schema_path){ schema_path_for('capture') }
|
6
|
+
subject{ fixture('capture') }
|
7
|
+
let(:root_key){ subject.keys.first }
|
8
|
+
|
9
|
+
root_wont_allow_additional_properties
|
10
|
+
spec_attribute 'transaction_type', value: 'capture'
|
11
|
+
spec_attribute 'reference_id', spec: 'unique_id'
|
12
|
+
spec_attribute 'transaction_id'
|
13
|
+
spec_attribute 'usage'
|
14
|
+
spec_attribute 'amount'
|
15
|
+
spec_attribute 'currency'
|
16
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
|
4
|
+
describe 'DebitSale JSON Schema' do
|
5
|
+
let(:schema_path){ schema_path_for('debit_sale') }
|
6
|
+
subject{ fixture('debit_sale') }
|
7
|
+
let(:root_key){ subject.keys.first }
|
8
|
+
|
9
|
+
root_wont_allow_additional_properties
|
10
|
+
spec_attribute 'transaction_type', value: 'debit_sale'
|
11
|
+
spec_attribute 'transaction_id'
|
12
|
+
spec_attribute 'usage'
|
13
|
+
spec_attribute 'remote_ip', required: true
|
14
|
+
spec_attribute 'amount'
|
15
|
+
spec_attribute 'currency'
|
16
|
+
|
17
|
+
spec_attribute 'wire_reference_id'
|
18
|
+
spec_attribute 'bank_account_holder'
|
19
|
+
spec_attribute 'bank_account_number'
|
20
|
+
spec_attribute 'bank_number'
|
21
|
+
|
22
|
+
spec_attribute 'customer_email', required: true
|
23
|
+
spec_attribute 'customer_phone'
|
24
|
+
spec_attribute 'billing_address', required: true
|
25
|
+
spec_attribute 'risk_params'
|
26
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
|
4
|
+
describe 'DirectPay24Sale JSON Schema' do
|
5
|
+
let(:schema_path){ schema_path_for('direct_pay24_sale') }
|
6
|
+
subject{ fixture('direct_pay24_sale') }
|
7
|
+
let(:root_key){ subject.keys.first }
|
8
|
+
|
9
|
+
root_wont_allow_additional_properties
|
10
|
+
spec_attribute 'transaction_type', value: 'direct_pay24_sale'
|
11
|
+
spec_attribute 'transaction_id'
|
12
|
+
spec_attribute 'usage'
|
13
|
+
spec_attribute 'remote_ip', required: true
|
14
|
+
spec_attribute 'amount'
|
15
|
+
spec_attribute 'currency'
|
16
|
+
|
17
|
+
spec_attribute 'wire_reference_id'
|
18
|
+
spec_attribute 'bank_account_holder'
|
19
|
+
spec_attribute 'bank_account_number'
|
20
|
+
spec_attribute 'bank_number'
|
21
|
+
|
22
|
+
spec_attribute 'customer_email', required: true
|
23
|
+
spec_attribute 'customer_phone'
|
24
|
+
spec_attribute 'billing_address', required: true
|
25
|
+
spec_attribute 'risk_params'
|
26
|
+
|
27
|
+
spec_attribute 'notification_url', spec: 'url'
|
28
|
+
spec_attribute 'return_success_url', spec: 'url'
|
29
|
+
spec_attribute 'return_failure_url', spec: 'url'
|
30
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
|
4
|
+
describe 'DebitSale JSON Schema' do
|
5
|
+
let(:schema_path){ schema_path_for('giro_pay_sale') }
|
6
|
+
subject{ fixture('giro_pay_sale') }
|
7
|
+
let(:root_key){ subject.keys.first }
|
8
|
+
|
9
|
+
root_wont_allow_additional_properties
|
10
|
+
spec_attribute 'transaction_type', value: 'giro_pay_sale'
|
11
|
+
spec_attribute 'transaction_id'
|
12
|
+
spec_attribute 'usage'
|
13
|
+
spec_attribute 'remote_ip', required: true
|
14
|
+
spec_attribute 'amount'
|
15
|
+
spec_attribute 'currency'
|
16
|
+
|
17
|
+
spec_attribute 'wire_reference_id'
|
18
|
+
spec_attribute 'bank_account_holder'
|
19
|
+
spec_attribute 'bank_account_number'
|
20
|
+
spec_attribute 'bank_number'
|
21
|
+
|
22
|
+
spec_attribute 'customer_email', required: true
|
23
|
+
spec_attribute 'customer_phone'
|
24
|
+
spec_attribute 'billing_address', required: true
|
25
|
+
spec_attribute 'risk_params'
|
26
|
+
|
27
|
+
spec_attribute 'notification_url', spec: 'url'
|
28
|
+
spec_attribute 'return_success_url', spec: 'url'
|
29
|
+
spec_attribute 'return_failure_url', spec: 'url'
|
30
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
|
4
|
+
describe 'iDealSale JSON Schema' do
|
5
|
+
let(:schema_path){ schema_path_for('ideal_sale') }
|
6
|
+
subject{ fixture('ideal_sale') }
|
7
|
+
let(:root_key){ subject.keys.first }
|
8
|
+
|
9
|
+
root_wont_allow_additional_properties
|
10
|
+
spec_attribute 'transaction_type', value: 'ideal_sale'
|
11
|
+
spec_attribute 'transaction_id'
|
12
|
+
spec_attribute 'usage'
|
13
|
+
spec_attribute 'remote_ip', required: true
|
14
|
+
spec_attribute 'amount'
|
15
|
+
spec_attribute 'currency'
|
16
|
+
|
17
|
+
spec_attribute 'bank_account_holder'
|
18
|
+
spec_attribute 'bank_account_number'
|
19
|
+
spec_attribute 'bank_number'
|
20
|
+
|
21
|
+
spec_attribute 'customer_email', required: true
|
22
|
+
spec_attribute 'customer_phone'
|
23
|
+
spec_attribute 'billing_address', required: true
|
24
|
+
spec_attribute 'risk_params'
|
25
|
+
|
26
|
+
spec_attribute 'notification_url', spec: 'url'
|
27
|
+
spec_attribute 'return_success_url', spec: 'url'
|
28
|
+
spec_attribute 'return_failure_url', spec: 'url'
|
29
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
|
4
|
+
describe 'InitRecurringAuthorize JSON Schema' do
|
5
|
+
let(:schema_path){ schema_path_for('init_recurring_authorize') }
|
6
|
+
subject{ fixture('init_recurring_authorize') }
|
7
|
+
let(:root_key){ subject.keys.first }
|
8
|
+
|
9
|
+
root_wont_allow_additional_properties
|
10
|
+
spec_attribute 'transaction_type', value: 'init_recurring_authorize'
|
11
|
+
spec_attribute 'transaction_id'
|
12
|
+
spec_attribute 'usage'
|
13
|
+
spec_attribute 'remote_ip', required: true
|
14
|
+
spec_attribute 'amount'
|
15
|
+
spec_attribute 'currency'
|
16
|
+
spec_attribute 'card_holder'
|
17
|
+
spec_attribute 'card_number'
|
18
|
+
spec_attribute 'cvv'
|
19
|
+
spec_attribute 'expiration_month'
|
20
|
+
spec_attribute 'expiration_year'
|
21
|
+
spec_attribute 'customer_email', required: true
|
22
|
+
spec_attribute 'customer_phone'
|
23
|
+
spec_attribute 'billing_address', required: true
|
24
|
+
spec_attribute 'risk_params'
|
25
|
+
spec_attribute 'recurring_schedule'
|
26
|
+
end
|