def test_rebate(self, valid_card_with_cvn): client = ApiClient(self.secret) auth_request = AuthRequest( merchantid=self.merchant_id, card=valid_card_with_cvn, amount=100, currency='EUR', autosettle='1', comments=['comment one', 'comment two'] ) auth_response = client.send(auth_request) assert auth_response.result == '00' request = Rebate( merchantid=self.merchant_id, amount=100, currency='EUR', pasref=auth_response.pasref, authcode=auth_response.authcode, refundhash=auth_request.sha1hash, comments=['comment one', 'comment two'] ) response = client.send(request) assert response.result == '00'
def test_three_ds_verify_enrolled(self, valid_card): request = ThreeDsVerifyEnrolled( merchantid=self.merchant_id, card=valid_card, amount=100, currency='EUR', comments=['comment one', 'comment two']) client = ApiClient(self.secret) response = client.send(request) assert response.result == '00'
def test_auth_declined(self, declined_card_with_cvn): request = AuthRequest(merchantid=self.merchant_id, card=declined_card_with_cvn, amount=100, currency='EUR', autosettle='1', comments=['comment one', 'comment two']) client = ApiClient(self.secret) response = client.send(request) assert response.result == '101'
def test_auth_recurring(self, valid_card_with_cvn, recurring): request = AuthRequestWithRecurring( merchantid=self.merchant_id, card=valid_card_with_cvn, amount=100, currency='EUR', autosettle='1', comments=['comment one', 'comment two'], recurring=recurring) client = ApiClient(self.secret) response = client.send(request) assert response.result == '00'
def test_dcc_rate(self, dcc_info_with_rate_type, valid_card): request = DccRate( merchantid=self.merchant_id, card=valid_card, amount=100, currency='EUR', dccinfo=dcc_info_with_rate_type, comments=['comment one', 'comment two'] ) client = ApiClient(self.secret) response = client.send(request) assert response.result == '00'
def test_auth_with_dcc_info(self, valid_card_with_cvn, dcc_info_with_amount): request = AuthRequestWithDccInfo( merchantid=self.merchant_id, card=valid_card_with_cvn, amount=100, currency='EUR', autosettle='1', comments=['comment one', 'comment two'], dccinfo=dcc_info_with_amount ) client = ApiClient(self.secret) response = client.send(request) assert response.result == '00'
def test_payer_edit(self, payer): client = ApiClient(self.secret) request_new = PayerNewRequest(merchantid=self.merchant_id, payer=payer) response_new = client.send(request_new) # Because it can not be removed, the payer may exist (501) assert response_new.result == '00' or response_new.result == '501' payer.firstname = 'Updated {}'.format(payer.firstname) request = PayerEditRequest( merchantid=self.merchant_id, payer=payer, comments=['comment one', 'comment two'], ) response = client.send(request) assert response.result == '00'
def test_three_ds_verify_sig(self): request = ThreeDsVerifySig( merchantid=self.merchant_id, amount=100, currency='EUR', pares= "eJzNV1uTokoSft9fMdHn0ZiB4qIwQbtR3FFBQZDLGzcB5SagIL9+sZ3p6T3RJ87sPmzsE1UZWV9+WZUfWcX8cyjyL7" "e4abOqfH0B39CXL3EZVlFWJq8vlil+pV7+ufwHY6ZNHPP7OLw28ZJR47b1k/hLFr2+xEc/9vEAhCGOE4uIprAopDGMWvg0PQ/x6" "GXJ7KARt2/OACUoFCepyfgj5nIK+Q1jkJ/TCbsJU7/slowfXlhFWxIowFCUQX5MmSJuFH5JE/icxDHAIM85g/xauLs+Ru1EdMii" "3H6Tyn0zOkuod3kv9kC3i2UPW2554lKAn9amWYH8qM/dCtjLaXfnarYXV/dqu0d52882wSnSKcAgz9rHu9S3DqXn8twfdOpfTqaf" "qa4f1XpxJG1Xy3/R/J//fkQvLRcLTizc3aSLq0rzqvpqxD1u6dqYlk4nn6UbO1T2occZ/1a2m4GHONO/F2ZAbSHoZy1FrZBV8dBW" "gOeIcrGV8eVfYULSiXvlxbkOlsFscbyZbBjptNbaom9pJbnYBjm/R6JAVxzRchr2H9fecfBpMkisAN0mwzD3ZpvhCrORlmLup07N" "92G30IF5XBJrMDkqXWpUPv241XDolt8Lv4fOdtgasvJOF4ptw6sDih0bmRD5Q4b+prKiO4FZFjJjbH+8YwnUiGyjDjJQcZhjLFUe" "Dqjl4ratXNR2eXlZrorTf62mx7AwQhmOdnAz2Tzv0SEFq9GB17JAh003JnbbrgXzUU08vzGRtTA+1uR/ipXJBfdz7k/R7464b49r" "J7e24+XiMfn6H/AvBh19Q=") client = ApiClient(self.secret) response = client.send(request) assert response.result == '00'
def test_void(self, valid_card_with_cvn): client = ApiClient(self.secret) auth_request = AuthRequest( merchantid=self.merchant_id, card=valid_card_with_cvn, amount=100, currency='EUR', autosettle='1', comments=['comment one', 'comment two'] ) auth_response = client.send(auth_request) assert auth_response.result == '00' request = Void( merchantid=self.merchant_id, pasref=auth_response.pasref, ) response = client.send(request) assert response.result == '00'
def test_three_ds_verify_enrolled(self, payer, valid_card_with_ref): client = ApiClient(self.secret) # Create payer if not exists request_new_payer = PayerNewRequest(merchantid=self.merchant_id, payer=payer) response_new_payer = client.send(request_new_payer) # Because it can not be removed, the payer may exist (501) assert response_new_payer.result == '00' or response_new_payer.result == '501' # Ensure that the payer reference is the correct valid_card_with_ref.payerref = payer.ref request_new = CardNewRequest(merchantid=self.merchant_id, comments=['comment one', 'comment two'], card=valid_card_with_ref) response_new = client.send(request_new) assert response_new.result == '00' request = RealVaultThreeDsVerifyEnrolled( merchantid=self.merchant_id, amount=100, currency='EUR', payerref=valid_card_with_ref.payerref, paymentmethod=valid_card_with_ref.ref, ) response = client.send(request) assert response.result == '00' request_cancel = CardCancelRequest( merchantid=self.merchant_id, comments=['comment one', 'comment two'], card=valid_card_with_ref) response_cancel = client.send(request_cancel) assert response_cancel.result == '00'
def test_real_vault_dcc_rate(self, payer, valid_card_with_ref, dcc_info): client = ApiClient(self.secret) # Create payer if not exists request_new_payer = PayerNewRequest(merchantid=self.merchant_id, payer=payer) response_new_payer = client.send(request_new_payer) # Because it can not be removed, the payer may exist (501) assert response_new_payer.result == '00' or response_new_payer.result == '501' # Ensure that the payer reference is the correct valid_card_with_ref.payerref = payer.ref request_new = CardNewRequest(merchantid=self.merchant_id, comments=['comment one', 'comment two'], card=valid_card_with_ref) response_new = client.send(request_new) assert response_new.result == '00' request = CardDccRateRequest(merchantid=self.merchant_id, amount=100, currency='EUR', payerref=valid_card_with_ref.payerref, paymentmethod=valid_card_with_ref.ref, comments=['comment one', 'comment two'], dccinfo=dcc_info) response = client.send(request) assert response.result == '00' request = CardCancelRequest(merchantid=self.merchant_id, comments=['comment one', 'comment two'], card=valid_card_with_ref) response = client.send(request) assert response.result == '00'
def test_card_update(self, payer, valid_card_with_ref): client = ApiClient(self.secret) # Create payer if not exists request_new_payer = PayerNewRequest(merchantid=self.merchant_id, payer=payer) response_new_payer = client.send(request_new_payer) # Because it can not be removed, the payer may exist (501) assert response_new_payer.result == '00' or response_new_payer.result == '501' # Ensure that the payer reference is the correct valid_card_with_ref.payerref = payer.ref request_new = CardNewRequest(merchantid=self.merchant_id, comments=['comment one', 'comment two'], card=valid_card_with_ref) response_new = client.send(request_new) assert response_new.result == '00' valid_card_with_ref.chname = 'update card owner' request = CardUpdateRequest(merchantid=self.merchant_id, comments=['comment one', 'comment two'], card=valid_card_with_ref) response = client.send(request) assert response.result == '00' request_cancel = CardCancelRequest( merchantid=self.merchant_id, comments=['comment one', 'comment two'], card=valid_card_with_ref) response_cancel = client.send(request_cancel) assert response_cancel.result == '00'
def test_receipt_in(self, payment_data, payer, valid_card_with_ref): client = ApiClient(self.secret) # Create payer if not exists request_new_payer = PayerNewRequest(merchantid=self.merchant_id, payer=payer) response_new_payer = client.send(request_new_payer) # Because it can not be removed, the payer may exist (501) assert response_new_payer.result == '00' or response_new_payer.result == '501' # Ensure that the payer reference is the correct valid_card_with_ref.payerref = payer.ref request_new = CardNewRequest(merchantid=self.merchant_id, comments=['comment one', 'comment two'], card=valid_card_with_ref) response_new = client.send(request_new) assert response_new.result == '00' request = ReceiptInRequest(merchantid=self.merchant_id, amount=100, currency='EUR', autosettle='1', comments=['comment one', 'comment two'], payerref=valid_card_with_ref.payerref, paymentmethod=valid_card_with_ref.ref, paymentdata=payment_data) response = client.send(request) assert response.result == '00' request_cancel = CardCancelRequest( merchantid=self.merchant_id, comments=['comment one', 'comment two'], card=valid_card_with_ref) response_cancel = client.send(request_cancel) assert response_cancel.result == '00'
def test_payer_new(self, payer): client = ApiClient(self.secret) request = PayerNewRequest(merchantid=self.merchant_id, payer=payer) response = client.send(request) assert response.result == '00'