def update_local(self, request): cim_payment_profile = CIMCustomerPaymentProfile( self.recurring_payment.customer_profile_id, self.payment_profile_id) success, response_d = cim_payment_profile.get() if success: if 'payment' in response_d['payment_profile']: if 'credit_card' in response_d['payment_profile']['payment'] and \ 'card_number' in response_d['payment_profile']['payment']['credit_card']: card_num = response_d['payment_profile']['payment']['credit_card']['card_number'][-4:] self.card_num = card_num self.owner = request.user self.owner_username = request.user.username self.save()
def update_local(self, request): cim_payment_profile = CIMCustomerPaymentProfile( self.recurring_payment.customer_profile_id, self.payment_profile_id) success, response_d = cim_payment_profile.get() if success: if response_d['payment_profile'].has_key('payment'): if response_d['payment_profile']['payment'].has_key('credit_card') and \ response_d['payment_profile']['payment']['credit_card'].has_key('card_number'): card_num = response_d['payment_profile']['payment']['credit_card']['card_number'][-4:] self.card_num = card_num self.owner = request.user self.owner_username = request.user.username self.save()