コード例 #1
0
achbank_Obj = ACHBankAccount(None)
achbank_Obj.accountHolderName("XYZ Company")
achbank_Obj.accountType("CHECKING")
achbank_Obj.accountNumber("988758392")
achbank_Obj.routingNumber("211589828")
achbank_Obj.payMethod("PPD")

profile_Obj = Profile(None)
profile_Obj.firstName("Joe")
profile_Obj.lastName("Smith")
profile_Obj.email("*****@*****.**")

billingdetails_Obj = BillingDetails(None)
billingdetails_Obj.street("100 Queen Street West")
billingdetails_Obj.city("Los Angeles")
billingdetails_Obj.state("CA")
billingdetails_Obj.country("US")
billingdetails_Obj.zip("90210")
billingdetails_Obj.phone("3102649010")

standalone_Obj.profile(profile_Obj)
standalone_Obj.billingDetails(billingdetails_Obj)
standalone_Obj.ach(achbank_Obj)

response_object = optimal_obj.direct_debit_service_handler().submit_standalone(
    standalone_Obj)

print("\nResponse Values ==========> ")
Utils.print_response(response_object)
#!/usr/bin/env python3
'''
Created on 1-June-2016

@author: Asawari.Vaidya
'''
from PythonPaysafeSDK.CustomerVault.ACHBankAccount import ACHBankAccount
from PythonPaysafeSDK.DirectDebit.Purchase import Purchase
from PythonPaysafeSDK.PaysafeApiClient import PaysafeApiClient
from utils.Utils import Utils

from Config import Config
from RandomTokenGenerator import RandomTokenGenerator

optimal_obj = PaysafeApiClient(Config.api_key, Config.api_password,
                               Config.environment, Config.account_number)
purchase_obj = Purchase(None)
purchase_obj.merchantRefNum(RandomTokenGenerator().generateToken())
purchase_obj.amount(100.98 * Config.currency_base_units_multiplier)

achbank_obj = ACHBankAccount(None)
achbank_obj.payMethod("WEB")
achbank_obj.paymentToken("DeZpXwrWtKIt8pN")
purchase_obj.ach(achbank_obj)

response_object = optimal_obj.direct_debit_service_handler().submit_purchase(
    purchase_obj)

print("\nResponse Values ==========> ")
Utils.print_response(response_object)