New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Debit class has no self.refunds_uri
#70
Comments
At the moment, I'm actually unable to issue refunds so I think this is fairly important. |
@peterbe can you list the request id? |
@mahmoudimus The full thing? |
@peterbe that's the request ID for the 405. Can you get us the request ID (or the URI potentially) for the GET request to get the debit that does not have the refund uri? When I CURL the debits for the marketplace associated with the above OHM, I can see the
Can you show us the code that you're running? I suspect that you're doing |
This is my code: balanced.configure(settings.BALANCED_API_KEY)
debit = balanced.Debit.find(payment.balanced_uri)
description = form.cleaned_data.get('description')
if not description:
description = 'Refund for %s' % payment.item.identifier
refund_cents = int(Decimal('100') * refund_amount_after)
print debit.refund(
amount=refund_cents,
description=description,
meta={
'payment.id': str(payment.pk),
'item.identifier': payment.item.identifier,
}
) That balanced.configure(settings.BALANCED_API_KEY)
customer = balanced.Customer().save()
customer.add_card(form.cleaned_data['uri']) #<-- this is the same as `payment.balanced_uri`
customer.debit(
amount=amount_cents,
appears_on_statement_as=appears_on_statement_as,
description=description,
) |
@peterbe can you show us |
|
OK. there's our issue. that's a URI for a card, not a debit. you can find the debits associated with that card by doing balanced.configure(settings.BALANCED_API_KEY)
card_uri = balanced.payment_uri
card = balanced.Card.find(card_uri)
card.debits # gives you an iterator over the debits associated with this card let us know if that helps, if you're not sure how you got that URI in the first place jump on #balanced on irc.freenode.net and we'll figure it out together. |
Thank you! |
Been looking at this class:
But when you try to use this, you get
AttributeError: 'Debit' object has no attribute 'refunds_uri'
I tried changing
self.refunds_uri
toself.uri
but then I got:HTTPError: Method Not Allowed: 405: Your request id is OHM2f81d254500c11e...redacted....
The text was updated successfully, but these errors were encountered: