import cgitb

from PythonPaysafeSDK.CustomerVault.Card import Card
from PythonPaysafeSDK.CustomerVault.Profile import Profile
from PythonPaysafeSDK.PaysafeApiClient import PaysafeApiClient
from PythonPaysafeSDK.common.CardExpiry import CardExpiry

from Config import Config

cgitb.enable()

form = cgi.FieldStorage()
profile_id = form.getvalue('profileId')
card_num = form.getvalue('cardNumber')

optimal_obj = PaysafeApiClient(Config.api_key, Config.api_password,
                               Config.environment, Config.account_number)

card_obj = Card(None)
card_obj.nickName("John's corporate Visa")
card_obj.holderName("MR. JOHN SMITH")
card_obj.cardNum(card_num)
#card_obj.cardNum("4510150000000321")
card_obj.defaultCardIndicator("true")
card_exp_obj = CardExpiry(None)
card_exp_obj.month("12")
card_exp_obj.year("2019")
profile_obj = Profile(None)
profile_obj.id(profile_id)
#profile_obj.id("e17871ed-5430-4234-a6fb-f3c9ccf995cf")
card_obj.profile(profile_obj)
card_obj.cardExpiry(card_exp_obj)
Beispiel #2
0
'''
Created on 1-June-2016

@author: Asawari.Vaidya
'''
from PythonPaysafeSDK.CardPayments.BillingDetails import BillingDetails
from PythonPaysafeSDK.CustomerVault.ACHBankAccount import ACHBankAccount
from PythonPaysafeSDK.CustomerVault.Profile import Profile
from PythonPaysafeSDK.DirectDebit.StandaloneCredits import StandaloneCredits
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)
standalone_Obj = StandaloneCredits(None)
standalone_Obj.merchantRefNum(RandomTokenGenerator().generateToken())
standalone_Obj.amount(100.98 * Config.currency_base_units_multiplier)
standalone_Obj.customerIp("192.0.126.111")

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")
Beispiel #3
0
#!/usr/bin/env python3
'''
Created on 1-June-2016

@author: Asawari.Vaidya
'''
from PythonPaysafeSDK.CustomerVault.Addresses import Address
from PythonPaysafeSDK.CustomerVault.EFTBankAccount import EFTBankAccount
from PythonPaysafeSDK.CustomerVault.Profile import Profile
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)

# Create Customer Profile
profile_obj = Profile(None)
profile_obj.merchantCustomerId(RandomTokenGenerator().generateToken())
profile_obj.locale("en_US")
profile_obj.firstName("John")
profile_obj.lastName("Smith")
profile_obj.email("*****@*****.**")
profile_obj.phone("713-444-5555")

response_object = optimal_obj.customer_vault_service_handler().create_profile(
    profile_obj)

# Create Address
address_obj = Address(None)
from PythonPaysafeSDK.ThreeDSecureV2.UserAccountDetails import UserAccountDetails
from PythonPaysafeSDK.ThreeDSecureV2.Profile import Profile
from PythonPaysafeSDK.ThreeDSecureV2.PaymentAccountDetails import PaymentAccountDetails
from PythonPaysafeSDK.ThreeDSecureV2.PriorThreeDSAuthentication import PriorThreeDSAuthentication
from PythonPaysafeSDK.ThreeDSecureV2.ShippingDetailsUsage import ShippingDetailsUsage
from PythonPaysafeSDK.ThreeDSecureV2.TravelDetails import TravelDetails
from PythonPaysafeSDK.ThreeDSecureV2.UserLogin import UserLogin
from PythonPaysafeSDK.common.CardExpiry import CardExpiry
from PythonPaysafeSDK.PaysafeApiClient import PaysafeApiClient
from PythonPaysafeSDK.ThreeDSecureV2.Authentications import Authentications
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)
# Submit Authentication with card details
authentications_obj = Authentications(None)
card_obj = Card(None)
card_expiry_obj = CardExpiry(None)
billingDetails_obj = BillingDetails(None)
shippingDetails_obj = ShippingDetails(None)
profile_obj = Profile(None)
billingCycle_obj = BillingCycle(None)
orderItemDetails_obj = OrderItemDetails(None)
purchasedGiftCardDetails_obj = PurchasedGiftCardDetails(None)
userAccountDetails_obj = UserAccountDetails(None)
paymentAccountDetails_obj = PaymentAccountDetails(None)
priorThreeDSAuthentication_obj = PriorThreeDSAuthentication(None)
shippingDetailsUsage_obj = ShippingDetailsUsage(None)
travelDetails_obj = TravelDetails(None)
from PythonPaysafeSDK.CardPayments.Card import Card
from PythonPaysafeSDK.CardPayments.CardExpiry import CardExpiry
from PythonPaysafeSDK.PaysafeApiClient import PaysafeApiClient

from Config import Config
from RandomTokenGenerator import RandomTokenGenerator


cgitb.enable()
#from sample_application.RandomTokenGenerator import RandomTokenGenerator
#from sample_application.Config import Config

form = cgi.FieldStorage()
card_num = form.getvalue('cardNumber')

optimal_obj = PaysafeApiClient(Config.api_key, Config.api_password, Config.environment, Config.account_number)

auth_obj = Authorization(None)
card_obj = Card(None)
cardExpiry_obj = CardExpiry(None)
billing_obj = BillingDetails(None)
		
auth_obj.merchantRefNum(RandomTokenGenerator().generateToken())
auth_obj.amount(10 * Config.currency_base_units_multiplier)
auth_obj.settleWithAuth("false")

#card_obj.cardNum("4530910000012345")		
card_obj.cardNum(card_num)
card_obj.cvv("123")
auth_obj.card(card_obj)
		
Beispiel #6
0
'''
Created on 1-June-2016

@author: Asawari.Vaidya
'''
from PythonPaysafeSDK.CardPayments.Card import Card
from PythonPaysafeSDK.CardPayments.CardExpiry import CardExpiry
from PythonPaysafeSDK.PaysafeApiClient import PaysafeApiClient
from PythonPaysafeSDK.ThreeDSecure.Authentications import Authentications
from PythonPaysafeSDK.ThreeDSecure.EnrollmentChecks import EnrollmentChecks
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)
# Submit Enrollment Request
enrollment_Obj = EnrollmentChecks(None)
enrollment_Obj.merchantRefNum(RandomTokenGenerator().generateToken())
enrollment_Obj.amount(50 * Config.currency_base_units_multiplier)
enrollment_Obj.currency(Config.currency_code)
enrollment_Obj.customerIp("172.0.0.1")
enrollment_Obj.userAgent(
    "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36"
)
enrollment_Obj.acceptHeader(
    "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"
)
enrollment_Obj.merchantUrl("https://www.merchant.com")

card_Obj = Card(None)