def __init__(self, utid=None, reward_name=None, currency_code=None, status=None, value_type=None, reward_type=None, created_date=None, last_update_date=None, countries=None, min_value=None, max_value=None, face_value=None): """Constructor for the ItemModel class""" # Initialize members of the class self.utid = utid self.reward_name = reward_name self.currency_code = currency_code self.status = status self.value_type = value_type self.reward_type = reward_type self.created_date = APIHelper.RFC3339DateTime( created_date) if created_date else None self.last_update_date = APIHelper.RFC3339DateTime( last_update_date) if last_update_date else None self.countries = countries self.min_value = min_value self.max_value = max_value self.face_value = face_value
def __init__(self, customer_identifier=None, account_identifier=None, token=None, label=None, last_four_digits=None, expiration_date=None, status=None, created_date=None, activation_date=None, contact_information=None): """Constructor for the CreditCardModel class""" # Initialize members of the class self.customer_identifier = customer_identifier self.account_identifier = account_identifier self.token = token self.label = label self.last_four_digits = last_four_digits self.expiration_date = expiration_date self.status = status self.created_date = APIHelper.RFC3339DateTime( created_date) if created_date else None self.activation_date = APIHelper.RFC3339DateTime( activation_date) if activation_date else None self.contact_information = contact_information
def test_test_get_credit_card(self): # Parameters for the API call token = '56ac1a30-6ba2-4047-9b8c-70f97a5502c5' # Perform the API call through the SDK function result = self.controller.get_credit_card(token) # Test response code self.assertEquals(self.response_catcher.response.status_code, 200) # Test whether the captured response is as we expected self.assertIsNotNone(result) expected_body = APIHelper.json_deserialize( '{"customerIdentifier":"sdkautotest4","accountIdentifier":"sdkautotest5","t' 'oken":"56ac1a30-6ba2-4047-9b8c-70f97a5502c5","label":"SDK Auto Testing Card' ' 1","lastFourDigits":"4444","expirationDate":"2020-01","status":"ACTIVE","c' 'reatedDate":"2018-04-26T18:52:17.575Z","activationDate":"2018-04-26T18:52:1' '7.575Z","contactInformation":[{"fullName":"Test User","emailAddress":"test@' 'example.com"},{"fullName":"Test Man Two","emailAddress":"*****@*****.**"' '}],"accountNumber":"A32386768"}') received_body = APIHelper.json_deserialize( self.response_catcher.response.raw_body) self.assertTrue( TestHelper.match_body(expected_body, received_body, check_values=True))
def test_test_retrieve_catalog(self): # Perform the API call through the SDK function result = self.controller.get_catalog() # Test response code self.assertEquals(self.response_catcher.response.status_code, 200) # Test whether the captured response is as we expected self.assertIsNotNone(result) expected_body = APIHelper.json_deserialize( '{"catalogName":"TestCatalog","brands":[{"brandKey":"B916708","brandName":"' 'Amazon.com","disclaimer":"disclaimer","description":"desc","shortDescriptio' 'n":"short desc","terms":"terms","createdDate":"2016-06-17T16:52:24Z","lastU' 'pdateDate":"2017-10-23T22:18:51Z","imageUrls":{"80w-326ppi":"https://d30s7y' 'zk2az89n.cloudfront.net/images/brands/b916708-80w-326ppi.png","130w-326ppi"' ':"https://d30s7yzk2az89n.cloudfront.net/images/brands/b916708-130w-326ppi.p' 'ng","200w-326ppi":"https://d30s7yzk2az89n.cloudfront.net/images/brands/b916' '708-200w-326ppi.png","278w-326ppi":"https://d30s7yzk2az89n.cloudfront.net/i' 'mages/brands/b916708-278w-326ppi.png","300w-326ppi":"https://d30s7yzk2az89n' '.cloudfront.net/images/brands/b916708-300w-326ppi.png","1200w-326ppi":"http' 's://d30s7yzk2az89n.cloudfront.net/images/brands/b916708-1200w-326ppi.png"},' '"status":"active","items":[{"utid":"U666425","rewardName":"Amazon.com Gift ' 'Card","currencyCode":"USD","status":"active","valueType":"VARIABLE_VALUE","' 'rewardType":"gift card","minValue":0.01,"maxValue":2000,"createdDate":"2016' '-06-17T17:38:45.294Z","lastUpdateDate":"2017-12-15T01:27:49.607Z","countrie' 's":["US"]}]},{"brandKey":"B725361","brandName":"AMC Theatres®","disclaimer"' ':"discl","description":"desc","shortDescription":"short desc","terms":"term' 's","createdDate":"2016-06-23T21:53:45Z","lastUpdateDate":"2016-07-25T22:41:' '11Z","imageUrls":{"80w-326ppi":"https://d30s7yzk2az89n.cloudfront.net/image' 's/brands/b725361-80w-326ppi.png","130w-326ppi":"https://d30s7yzk2az89n.clou' 'dfront.net/images/brands/b725361-130w-326ppi.png","200w-326ppi":"https://d3' '0s7yzk2az89n.cloudfront.net/images/brands/b725361-200w-326ppi.png","278w-32' '6ppi":"https://d30s7yzk2az89n.cloudfront.net/images/brands/b725361-278w-326' 'ppi.png","300w-326ppi":"https://d30s7yzk2az89n.cloudfront.net/images/brands' '/b725361-300w-326ppi.png","1200w-326ppi":"https://d30s7yzk2az89n.cloudfront' '.net/images/brands/b725361-1200w-326ppi.png"},"status":"active","items":[{"' 'utid":"U154092","rewardName":"AMC® Gift Card $10.00","currencyCode":"USD","' 'status":"active","valueType":"FIXED_VALUE","rewardType":"gift card","faceVa' 'lue":10,"createdDate":"2016-07-27T02:54:30.142Z","lastUpdateDate":"2016-09-' '21T20:59:01.874Z","countries":["US"]},{"utid":"U913336","rewardName":"AMC® ' 'Gift Card $25.00","currencyCode":"USD","status":"active","valueType":"FIXED' '_VALUE","rewardType":"gift card","faceValue":25,"createdDate":"2016-07-27T0' '2:55:37.899Z","lastUpdateDate":"2016-10-17T20:55:00.386Z","countries":["US"' ']},{"utid":"U652361","rewardName":"AMC® Gift Card $50.00","currencyCode":"U' 'SD","status":"active","valueType":"FIXED_VALUE","rewardType":"gift card","f' 'aceValue":50,"createdDate":"2016-07-27T02:56:53.391Z","lastUpdateDate":"201' '6-09-21T20:59:16.283Z","countries":["US"]}]}]}') received_body = APIHelper.json_deserialize( self.response_catcher.response.raw_body) self.assertTrue(TestHelper.match_body(expected_body, received_body))
def test_test_status_is_ok(self): # Perform the API call through the SDK function result = self.controller.get_system_status() # Test response code self.assertEquals(self.response_catcher.response.status_code, 200) # Test whether the captured response is as we expected self.assertIsNotNone(result) expected_body = APIHelper.json_deserialize('{"status":"UP"}') received_body = APIHelper.json_deserialize( self.response_catcher.response.raw_body) self.assertTrue(TestHelper.match_body(expected_body, received_body))
def __init__(self, reference_order_id=None, customer_identifier=None, account_identifier=None, account_number=None, amount_charged=None, margin_share=None, utid=None, reward_name=None, sender=None, recipient=None, send_email=None, status=None, created_at=None, etid=None): """Constructor for the OrderSummaryModel class""" # Initialize members of the class self.reference_order_id = reference_order_id self.customer_identifier = customer_identifier self.account_identifier = account_identifier self.account_number = account_number self.amount_charged = amount_charged self.margin_share = margin_share self.utid = utid self.reward_name = reward_name self.sender = sender self.recipient = recipient self.send_email = send_email self.status = status self.created_at = APIHelper.RFC3339DateTime( created_at) if created_at else None self.etid = etid
def __init__(self, created_at=None, id=None): """Constructor for the ResendOrderResponseModel class""" # Initialize members of the class self.created_at = APIHelper.RFC3339DateTime(created_at) if created_at else None self.id = id
def __init__(self, created_date=None, message=None, token=None): """Constructor for the UnregisterCreditCardResponseModel class""" # Initialize members of the class self.created_date = APIHelper.RFC3339DateTime( created_date) if created_date else None self.message = message self.token = token
def test_test_retrieve_exchange_rates(self): # Perform the API call through the SDK function result = self.controller.get_exchange_rates() # Test response code self.assertEquals(self.response_catcher.response.status_code, 200) # Test whether the captured response is as we expected self.assertIsNotNone(result) expected_body = APIHelper.json_deserialize( '{"disclaimer":"Exchange rates are provided here for reference. They are up' 'dated at least once a day and may have changed by time of order.","exchange' 'Rates":[{"lastModifiedDate":"2018-04-19T13:00:14.291","rewardCurrency":"EUR' '","baseCurrency":"NZD","baseFx":0.59120},{"lastModifiedDate":"2018-04-19T13' ':00:14.291","rewardCurrency":"USD","baseCurrency":"NZD","baseFx":0.73130},{' '"lastModifiedDate":"2018-04-19T13:00:14.230","rewardCurrency":"INR","baseCu' 'rrency":"AUD","baseFx":51.29066}]}') received_body = APIHelper.json_deserialize( self.response_catcher.response.raw_body) self.assertTrue(TestHelper.match_body(expected_body, received_body))
def test_test_get_all_accounts(self): # Perform the API call through the SDK function result = self.controller.get_all_accounts() # Test response code self.assertEquals(self.response_catcher.response.status_code, 200) # Test whether the captured response is as we expected self.assertIsNotNone(result) expected_body = APIHelper.json_deserialize( '[{"accountIdentifier":"sdkautotest2","accountNumber":"A11720237","displayN' 'ame":"SDK Auto Testing 2","currencyCode":"USD","currentBalance":0,"createdA' 't":"2018-04-26T18:13:45.196Z","status":"ACTIVE","contactEmail":"test@exampl' 'e.com"}]') received_body = APIHelper.json_deserialize( self.response_catcher.response.raw_body) self.assertTrue( TestHelper.match_body(expected_body, received_body, check_values=True))
def test_test_get_all_customers(self): # Perform the API call through the SDK function result = self.controller.get_all_customers() # Test response code self.assertEquals(self.response_catcher.response.status_code, 200) # Test whether the captured response is as we expected self.assertIsNotNone(result) expected_body = APIHelper.json_deserialize( '[{"customerIdentifier":"sdkautotest1","displayName":"SDK Auto Testing 1","' 'status":"active","createdAt":"2018-04-26T18:13:12.874Z","accounts":[{"accou' 'ntIdentifier":"sdkautotest3","accountNumber":"A01335766","displayName":"SDK' ' Auto Testing 3","createdAt":"2018-04-26T18:16:51.652Z","status":"ACTIVE"},' '{"accountIdentifier":"sdkautotest2","accountNumber":"A11720237","displayNam' 'e":"SDK Auto Testing 2","createdAt":"2018-04-26T18:13:45.196Z","status":"AC' 'TIVE"}]}]' ) received_body = APIHelper.json_deserialize(self.response_catcher.response.raw_body) self.assertTrue(TestHelper.match_body(expected_body, received_body, check_values = True))
def test_test_add_funds(self): # Parameters for the API call body = APIHelper.json_deserialize( '{"accountIdentifier":"sdkautotest5","amount":1.25,"creditCardToken":"56ac1' 'a30-6ba2-4047-9b8c-70f97a5502c5","customerIdentifier":"sdkautotest4"}', DepositRequestModel.from_dictionary) # Perform the API call through the SDK function result = self.controller.add_funds(body) # Test response code self.assertEquals(self.response_catcher.response.status_code, 200) # Test whether the captured response is as we expected self.assertIsNotNone(result) expected_body = APIHelper.json_deserialize( '{"referenceDepositID":"RAD-180426-5407","amount":1.25,"amountCharged":1.29' ',"feePercent":3.5,"createdDate":"2018-04-26T18:56:28.28Z","status":"SUCCESS' '","accountNumber":"A32386768"}') received_body = APIHelper.json_deserialize( self.response_catcher.response.raw_body) self.assertTrue(TestHelper.match_body(expected_body, received_body))
def test_test_get_deposit(self): # Parameters for the API call deposit_id = 'RAD-180426-5407' # Perform the API call through the SDK function result = self.controller.get_deposit(deposit_id) # Test response code self.assertEquals(self.response_catcher.response.status_code, 200) # Test whether the captured response is as we expected self.assertIsNotNone(result) expected_body = APIHelper.json_deserialize( '{"referenceDepositID":"RAD-180426-5407","amount":1.25,"amountCharged":1.29' ',"feePercent":3.5,"createdDate":"2018-04-26T18:56:28.28Z","status":"SUCCESS' '","accountNumber":"A32386768"}') received_body = APIHelper.json_deserialize( self.response_catcher.response.raw_body) self.assertTrue( TestHelper.match_body(expected_body, received_body, check_values=True))
def __init__(self, last_modified_date=None, reward_currency=None, base_currency=None, base_fx=None): """Constructor for the ExchangeRateModel class""" # Initialize members of the class self.last_modified_date = APIHelper.RFC3339DateTime( last_modified_date) if last_modified_date else None self.reward_currency = reward_currency self.base_currency = base_currency self.base_fx = base_fx
def __init__(self, account_identifier=None, account_number=None, display_name=None, created_at=None, status=None): """Constructor for the AccountSummaryModel class""" # Initialize members of the class self.account_identifier = account_identifier self.account_number = account_number self.display_name = display_name self.created_at = APIHelper.RFC3339DateTime( created_at) if created_at else None self.status = status
def test_test_place_order_with_minimum_criteria(self): # Parameters for the API call body = APIHelper.json_deserialize( '{"accountIdentifier":"sdkautotest5","amount":1.00,"customerIdentifier":"sd' 'kautotest4","sendEmail":false,"utid":"U561593"}', CreateOrderRequestModel.from_dictionary) # Perform the API call through the SDK function result = self.controller.create_order(body) # Test response code self.assertEquals(self.response_catcher.response.status_code, 201) # Test whether the captured response is as we expected self.assertIsNotNone(result) expected_body = APIHelper.json_deserialize( '{"referenceOrderID":"RA180426-1401-64","customerIdentifier":"sdkautotest4"' ',"accountIdentifier":"sdkautotest5","accountNumber":"A32386768","amountChar' 'ged":{"value":1,"currencyCode":"USD","total":1},"marginShare":{"value":0,"c' 'urrencyCode":"USD"},"denomination":{"value":1,"currencyCode":"USD"},"utid":' '"U561593","rewardName":"Reward Link","sender":{"firstName":"","lastName":""' ',"email":""},"recipient":{"email":"","firstName":"","lastName":""},"sendEma' 'il":false,"status":"COMPLETE","createdAt":"2018-04-26T20:08:59.624Z","rewar' 'd":{"credentials":{"Redemption URL":"https://sandbox.rewardlink.io/r/1/ed0H' 'tzSblNV6oFddNnnlf68eXzGQoREvcxwxu_Vi5Wk"},"credentialList":[{"label":"Redem' 'ption URL","value":"https://sandbox.rewardlink.io/r/1/ed0HtzSblNV6oFddNnnlf' '68eXzGQoREvcxwxu_Vi5Wk","type":"url"}],"redemptionInstructions":"<p>• ' 'Click on the redemption link above to activate your Reward Link.<br />\\r' '\\n• Next, you will be able to spend your balance on retail gift cards' '.</p>\\r\\n\\r\\n<p>If you don't want to spend your entire Reward Link ' 'value right away, save the email or URL and return via the redemption link ' '- your value will be waiting to be spent. This allows you to store the bala' 'nce to redeem at another time.</p>\\r\\n"}}') received_body = APIHelper.json_deserialize( self.response_catcher.response.raw_body) self.assertTrue(TestHelper.match_body(expected_body, received_body))
def __init__(self, amount=None, amount_charged=None, created_date=None, fee_percent=None, reference_deposit_id=None, status=None): """Constructor for the GetDepositResponseModel class""" # Initialize members of the class self.amount = amount self.amount_charged = amount_charged self.created_date = APIHelper.RFC3339DateTime( created_date) if created_date else None self.fee_percent = fee_percent self.reference_deposit_id = reference_deposit_id self.status = status
def __init__(self, reference_order_id=None, customer_identifier=None, account_identifier=None, account_number=None, amount_charged=None, denomination=None, utid=None, reward_name=None, send_email=None, status=None, created_at=None, reward=None, sender=None, recipient=None, etid=None, campaign=None, email_subject=None, external_ref_id=None, message=None, notes=None, margin_share=None): """Constructor for the OrderModel class""" # Initialize members of the class self.reference_order_id = reference_order_id self.customer_identifier = customer_identifier self.account_identifier = account_identifier self.account_number = account_number self.amount_charged = amount_charged self.denomination = denomination self.utid = utid self.reward_name = reward_name self.send_email = send_email self.status = status self.created_at = APIHelper.RFC3339DateTime(created_at) if created_at else None self.reward = reward self.sender = sender self.recipient = recipient self.etid = etid self.campaign = campaign self.email_subject = email_subject self.external_ref_id = external_ref_id self.message = message self.notes = notes self.margin_share = margin_share
def __init__(self, account_identifier=None, account_number=None, display_name=None, currency_code='USD', current_balance=None, created_at=None, status=None, contact_email=None): """Constructor for the AccountModel class""" # Initialize members of the class self.account_identifier = account_identifier self.account_number = account_number self.display_name = display_name self.currency_code = currency_code self.current_balance = current_balance self.created_at = APIHelper.RFC3339DateTime( created_at) if created_at else None self.status = status self.contact_email = contact_email