0001-sips2-add-support-for-captureMode-option-10953.patch
eopayment/sips2.py | ||
---|---|---|
109 | 109 |
'default': '978', |
110 | 110 |
'choices': ['978'], |
111 | 111 |
'required': True, |
112 |
} |
|
112 |
}, |
|
113 |
{ |
|
114 |
'name': 'capture_mode', |
|
115 |
'caption': _('Capture Mode'), |
|
116 |
'default': 'AUTHOR_CAPTURE', |
|
117 |
'choices': ['AUTHOR_CAPTURE', 'IMMEDIATE', 'VALIDATION'], |
|
118 |
'required': True, |
|
119 |
}, |
|
113 | 120 |
], |
114 | 121 |
} |
115 | 122 | |
... | ... | |
132 | 139 |
if self.automatic_return_url: |
133 | 140 |
data['automaticResponseUrl'] = self.automatic_return_url |
134 | 141 |
data['currencyCode'] = self.currency_code |
142 |
data['captureMode'] = self.capture_mode |
|
135 | 143 |
return data |
136 | 144 | |
137 | 145 |
def get_url(self): |
tests/test_sips2.py | ||
---|---|---|
7 | 7 |
backend = eopayment.Payment('sips2', {}) |
8 | 8 |
assert backend.request(amount='12') |
9 | 9 | |
10 |
def test_options(): |
|
11 |
payment = eopayment.Payment('sips2', {'capture_mode': 'VALIDATION'}) |
|
12 |
assert payment.backend.get_data()['captureMode'] == 'VALIDATION' |
|
13 | ||
10 | 14 |
def test_parse_response(): |
11 | 15 |
qs = '''Data=captureDay%3D0%7CcaptureMode%3DAUTHOR_CAPTURE%7CcurrencyCode%3D978%7CmerchantId%3D002001000000001%7CorderChannel%3DINTERNET%7CresponseCode%3D00%7CtransactionDateTime%3D2016-02-01T17%3A44%3A20%2B01%3A00%7CtransactionReference%3D668930%7CkeyVersion%3D1%7CacquirerResponseCode%3D00%7Camount%3D1200%7CauthorisationId%3D12345%7CcardCSCResultCode%3D4E%7CpanExpiryDate%3D201605%7CpaymentMeanBrand%3DMASTERCARD%7CpaymentMeanType%3DCARD%7CcustomerIpAddress%3D82.244.203.243%7CmaskedPan%3D5100%23%23%23%23%23%23%23%23%23%23%23%2300%7CorderId%3Dd4903de7027f4d56ac01634fd7ab9526%7CholderAuthentRelegation%3DN%7CholderAuthentStatus%3D3D_ERROR%7CtransactionOrigin%3DINTERNET%7CpaymentPattern%3DONE_SHOT&Seal=6ca3247765a19b45d25ad54ef4076483e7d55583166bd5ac9c64357aac097602&InterfaceVersion=HP_2.0&Encode=''' |
12 | 16 |
backend = eopayment.Payment('sips2', {}) |
13 |
- |