def getJohnsCardRegistration(self, cardType = CardType.CB_VISA_MASTERCARD): """Creates card registration object. return CardRegistration """ if (self._johnsCardRegistration == None): user = self.getJohn() cardRegistration = CardRegistration() cardRegistration.CardType = cardType cardRegistration.UserId = user.Id cardRegistration.Currency = 'EUR' self._johnsCardRegistration = self.sdk.cardRegistrations.Create(cardRegistration) return self._johnsCardRegistration
def getJohnsCardRegistration(self, cardType = CardType.CB_VISA_MASTERCARD): """Creates card registration object. return CardRegistration """ if (self._johnsCardRegistration == None): user = self.getJohn() cardRegistration = CardRegistration() cardRegistration.CardType = cardType cardRegistration.UserId = user.Id cardRegistration.Currency = 'EUR' self._johnsCardRegistration = self.sdk.cardRegistrations.Create(cardRegistration) return self._johnsCardRegistration
w.Currency = "EUR" return mangoapi.wallets.Create(w) with use_cassette("MangopayHarness"): cls = MangopayHarness cls.david_id = make_mangopay_account("David") cls.david_wallet_id = make_wallet(cls.david_id).Id cls.janet_id = make_mangopay_account("Janet") cls.janet_wallet_id = make_wallet(cls.janet_id).Id cr = CardRegistration() cr.UserId = cls.janet_id cr.Currency = "EUR" cr.CardType = "CB_VISA_MASTERCARD" cr = mangoapi.cardRegistrations.Create(cr) data = dict( accessKeyRef=cr.AccessKey, cardNumber="3569990000000132", cardExpirationDate="1234", cardCvx="123", data=cr.PreregistrationData, ) cr.RegistrationData = requests.post(cr.CardRegistrationURL, data).text cr = mangoapi.cardRegistrations.Update(cr) cls.card_id = cr.CardId del cr, data cls.homer_id = make_mangopay_account("Homer") cls.homer_wallet_id = make_wallet(cls.homer_id).Id
w.Currency = 'EUR' return mangoapi.wallets.Create(w) with use_cassette('MangopayHarness'): cls = MangopayHarness cls.david_id = make_mangopay_account('David') cls.david_wallet_id = make_wallet(cls.david_id).Id cls.janet_id = make_mangopay_account('Janet') cls.janet_wallet_id = make_wallet(cls.janet_id).Id cr = CardRegistration() cr.UserId = cls.janet_id cr.Currency = 'EUR' cr.CardType = 'CB_VISA_MASTERCARD' cr = mangoapi.cardRegistrations.Create(cr) data = dict( accessKeyRef=cr.AccessKey, cardNumber='3569990000000132', cardExpirationDate='1234', cardCvx='123', data=cr.PreregistrationData, ) cr.RegistrationData = requests.post(cr.CardRegistrationURL, data).text cr = mangoapi.cardRegistrations.Update(cr) cls.card_id = cr.CardId del cr, data cls.homer_id = make_mangopay_account('Homer') cls.homer_wallet_id = make_wallet(cls.homer_id).Id
w.Currency = 'EUR' return mangoapi.wallets.Create(w) with use_cassette('MangopayHarness'): cls = MangopayHarness cls.david_id = make_mangopay_account('David') cls.david_wallet_id = make_wallet(cls.david_id).Id cls.janet_id = make_mangopay_account('Janet') cls.janet_wallet_id = make_wallet(cls.janet_id).Id cr = CardRegistration() cr.UserId = cls.janet_id cr.Currency = 'EUR' cr.CardType = 'CB_VISA_MASTERCARD' cr = mangoapi.cardRegistrations.Create(cr) data = dict( accessKeyRef=cr.AccessKey, cardNumber='3569990000000132', cardExpirationDate='1234', cardCvx='123', data=cr.PreregistrationData, ) cr.RegistrationData = requests.post(cr.CardRegistrationURL, data).text cr = mangoapi.cardRegistrations.Update(cr) cls.card_id = cr.CardId del cr, data cls.homer_id = make_mangopay_account('Homer') cls.homer_wallet_id = make_wallet(cls.homer_id).Id