Skip to content
Browse files

Fix SOAP markup for typeFilter and price

  • Loading branch information...
1 parent 4d5e85f commit b93aa068260edafd3ab280ab2410ffb76b00332e @kumar303 kumar303 committed
Showing with 10 additions and 5 deletions.
  1. +1 −3 lib/bango/forms.py
  2. +9 −2 lib/bango/resources/billing.py
View
4 lib/bango/forms.py
@@ -2,8 +2,7 @@
from django import forms
-from lib.bango.constants import (COUNTRIES, CURRENCIES, PAYMENT_TYPES, RATINGS,
- RATINGS_SCHEME)
+from lib.bango.constants import COUNTRIES, CURRENCIES, RATINGS, RATINGS_SCHEME
from lib.sellers.models import SellerProductBango
from solitude.fields import ListField, URLField
@@ -104,7 +103,6 @@ class CreateBillingConfigurationForm(SellerProductForm):
@property
def bango_data(self):
data = super(CreateBillingConfigurationForm, self).bango_data
- data['typeFilter'] = PAYMENT_TYPES
data['externalTransactionId'] = uuid.uuid4()
del data['prices']
return data
View
11 lib/bango/resources/billing.py
@@ -1,6 +1,7 @@
from cached import Resource
from lib.bango.client import get_client
+from lib.bango.constants import PAYMENT_TYPES
from lib.bango.forms import CreateBillingConfigurationForm
from lib.bango.signals import create
@@ -22,12 +23,18 @@ def obj_create(self, bundle, request, **kwargs):
data = form.bango_data
# Exclude transaction from Bango but send it to the signal later.
transaction_uuid = data.pop('transaction_uuid')
- price_list = []
+
+ types = billing.factory.create('ArrayOfString')
+ for f in PAYMENT_TYPES:
+ types.string.append(f)
+ data['typeFilter'] = types
+
+ price_list = billing.factory.create('ArrayOfPrice')
for item in form.cleaned_data['prices']:
price = billing.factory.create('Price')
price.amount = item.cleaned_data['amount']
price.currency = item.cleaned_data['currency']
- price_list.append(price)
+ price_list.Price.append(price)
data['priceList'] = price_list

0 comments on commit b93aa06

Please sign in to comment.
Something went wrong with that request. Please try again.