Commit edecdca8 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_*: Rename add deposit payment script

   Entity is more accurate since it could be used on B2B context later.
parent 58895acb
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>Person_addDepositPayment</string> </value> <value> <string>Entity_addDepositPayment</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -34,7 +34,7 @@ class TestSlapOSAccountingScenario(TestSlapOSVirtualMasterScenarioMixin): ...@@ -34,7 +34,7 @@ class TestSlapOSAccountingScenario(TestSlapOSVirtualMasterScenarioMixin):
self.assertEqual(subscription_request.getSimulationState(), "submitted") self.assertEqual(subscription_request.getSimulationState(), "submitted")
with PinnedDateTime(self, DateTime('2021/04/04')): with PinnedDateTime(self, DateTime('2021/04/04')):
payment_transaction = owner_person.Person_addDepositPayment(99*10, currency.getRelativeUrl()) payment_transaction = owner_person.Entity_addDepositPayment(99*10, currency.getRelativeUrl())
# payzen interface will only stop the payment # payzen interface will only stop the payment
payment_transaction.stop() payment_transaction.stop()
self.tic() self.tic()
...@@ -209,7 +209,7 @@ class TestSlapOSAccountingScenario(TestSlapOSVirtualMasterScenarioMixin): ...@@ -209,7 +209,7 @@ class TestSlapOSAccountingScenario(TestSlapOSVirtualMasterScenarioMixin):
# Add deposit # Add deposit
with PinnedDateTime(self, creation_date + 2): with PinnedDateTime(self, creation_date + 2):
for person in person_list: for person in person_list:
payment_transaction = person.Person_addDepositPayment(99*100, currency.getRelativeUrl()) payment_transaction = person.Entity_addDepositPayment(99*100, currency.getRelativeUrl())
# payzen interface will only stop the payment # payzen interface will only stop the payment
payment_transaction.stop() payment_transaction.stop()
...@@ -311,7 +311,7 @@ class TestSlapOSAccountingScenario(TestSlapOSVirtualMasterScenarioMixin): ...@@ -311,7 +311,7 @@ class TestSlapOSAccountingScenario(TestSlapOSVirtualMasterScenarioMixin):
################################################## ##################################################
# Add deposit (0.1 to prevent discount generation) # Add deposit (0.1 to prevent discount generation)
with PinnedDateTime(self, creation_date + 0.1): with PinnedDateTime(self, creation_date + 0.1):
payment_transaction = owner_person.Person_addDepositPayment(99*100, currency.getRelativeUrl()) payment_transaction = owner_person.Entity_addDepositPayment(99*100, currency.getRelativeUrl())
# payzen interface will only stop the payment # payzen interface will only stop the payment
payment_transaction.stop() payment_transaction.stop()
......
...@@ -678,7 +678,7 @@ class DefaultScenarioMixin(TestSlapOSSecurityMixin): ...@@ -678,7 +678,7 @@ class DefaultScenarioMixin(TestSlapOSSecurityMixin):
# Action to submit project subscription # Action to submit project subscription
def wrapWithShadow(_person, *arg): def wrapWithShadow(_person, *arg):
return _person.Person_addDepositPayment(*arg) return _person.Entity_addDepositPayment(*arg)
payment_transaction = person.Person_restrictMethodAsShadowUser( payment_transaction = person.Person_restrictMethodAsShadowUser(
shadow_document=person, shadow_document=person,
callable_object=wrapWithShadow, callable_object=wrapWithShadow,
......
...@@ -56,7 +56,7 @@ class TestSlapOSCRMScenario(TestSlapOSVirtualMasterScenarioMixin): ...@@ -56,7 +56,7 @@ class TestSlapOSCRMScenario(TestSlapOSVirtualMasterScenarioMixin):
################################################## ##################################################
# Add deposit # Add deposit
with PinnedDateTime(self, creation_date): with PinnedDateTime(self, creation_date):
payment_transaction = owner_person.Person_addDepositPayment(99*100, currency.getRelativeUrl()) payment_transaction = owner_person.Entity_addDepositPayment(99*100, currency.getRelativeUrl())
# payzen interface will only stop the payment # payzen interface will only stop the payment
payment_transaction.stop() payment_transaction.stop()
......
...@@ -481,7 +481,7 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin): ...@@ -481,7 +481,7 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin):
# Action to submit project subscription # Action to submit project subscription
def wrapWithShadow(person, *arg): def wrapWithShadow(person, *arg):
return person.Person_addDepositPayment(*arg) return person.Entity_addDepositPayment(*arg)
payment_transaction = owner_person.Person_restrictMethodAsShadowUser( payment_transaction = owner_person.Person_restrictMethodAsShadowUser(
shadow_document=owner_person, shadow_document=owner_person,
callable_object=wrapWithShadow, callable_object=wrapWithShadow,
...@@ -561,7 +561,7 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin): ...@@ -561,7 +561,7 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin):
self.login() self.login()
project = self.portal.restrictedTraverse(project_relative_url) project = self.portal.restrictedTraverse(project_relative_url)
payment_transaction = customer_section_organisation.Person_addDepositPayment(99*10, currency.getRelativeUrl()) payment_transaction = customer_section_organisation.Entity_addDepositPayment(99*10, currency.getRelativeUrl())
# payzen interface will only stop the payment # payzen interface will only stop the payment
payment_transaction.stop() payment_transaction.stop()
self.tic() self.tic()
...@@ -865,7 +865,7 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin): ...@@ -865,7 +865,7 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin):
self.assertEqual(amount, deposit_amount) self.assertEqual(amount, deposit_amount)
def wrapWithShadow(_person, *arg): def wrapWithShadow(_person, *arg):
return _person.Person_addDepositPayment(*arg) return _person.Entity_addDepositPayment(*arg)
payment_transaction = project_owner_person.Person_restrictMethodAsShadowUser( payment_transaction = project_owner_person.Person_restrictMethodAsShadowUser(
shadow_document=project_owner_person, shadow_document=project_owner_person,
callable_object=wrapWithShadow, callable_object=wrapWithShadow,
......
...@@ -5,7 +5,7 @@ if currency_reference: ...@@ -5,7 +5,7 @@ if currency_reference:
currency_value = portal.portal_catalog.getResultValue( currency_value = portal.portal_catalog.getResultValue(
portal_type="Currency", portal_type="Currency",
reference=currency_reference, reference=currency_reference,
validation_state="validated") validation_state=("validated", "published"))
if currency_value is None: if currency_value is None:
raise ValueError("Unknown Currency: %s" % currency_reference) raise ValueError("Unknown Currency: %s" % currency_reference)
...@@ -18,7 +18,7 @@ if 0 >= deposit_price: ...@@ -18,7 +18,7 @@ if 0 >= deposit_price:
raise ValueError("Nothing to pay") raise ValueError("Nothing to pay")
def wrapWithShadow(entity, total_amount, currency_value, payment_mode): def wrapWithShadow(entity, total_amount, currency_value, payment_mode):
return entity.Person_addDepositPayment( return entity.Entity_addDepositPayment(
total_amount, total_amount,
currency_value.getRelativeUrl(), currency_value.getRelativeUrl(),
payment_mode=payment_mode payment_mode=payment_mode
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment