Package: upcpayment
UPC Python SDK allows you to implement accepting payments from Visa/MasterCard on your websiteDocumentation:Ukrainian,Russian,EnglishGenerate sign for PaymentPage-method:import upcpayment
from upcpayment.Upc_payment import Upc_payment

#example with additional fields
payment = Upc_payment('1756190', 'E7884956', 100, '980', 'ua', 123, 'description', alt_total_amount=123, alt_currency=978, sd='qwe', delay=1, ref3='something')
payment.generate_signature('path_to_file')
print('1: ', payment.signature)

#example for standard payment
payment = Upc_payment('1756190', 'E7884956', 100, '980', 'ua', 123, 'description')
payment.generate_signature('path_to_file')
print('2: ', payment.signature)

#example of wrong payment
payment = Upc_payment('1756190', 'E7884956', 100, '980', 'ua', 123, 'description', alt_total_amount=123, sd='qwe', delay=1, ref3='something')
payment.generate_signature('path_to_file')
print('3: ', payment.signature)PurchaseTime generated like this - datetime.datetime.now().strftime("%d%m%Y%H%M%S")When you make POST-request to gateway - take PurchaseTime from object payment -payment.purchase_timeXML-methodTo generate xml with signature use generate_xml_with_signature method to all objects:xml_with_sign = payment.generate_xml_with_signature('private_key')MPIEnrolMPIEnrolRequestfrom upcpayment import Upc_payment_xml

#With card data:
payment = Upc_payment_xml.MPIEnrolRequest('merchant_id', 'terminal_id', 'amount', 'currency', 'order_id', 'description', card_num='card_number', exp_year='exp_year', exp_month='exp_month')
#With UpcToken:
payment = Upc_payment_xml.MPIEnrolRequest('merchant_id', 'terminal_id', 'amount', 'currency', 'order_id', 'description', upctoken='upctoken')Additional arguments:device_categoryMPIAuthRequestpayment = Upc_payment_xml.MPIAuthRequest('merchant_id', 'terminal_id', 'order_id', 'status', 'cavv', 'eci', cavv_alg')AuthorizationRequestpayment = Upc_payment_xml.AuthorizationRequest('merchant_id', 'terminal_id', 'order_id', 'date', 'total_amount', 'currency',  'description', 'card_num', 'exp_year', 'exp_month', 'cv_num', 'status', 'cavv', 'eci', 'cavv_alg)RefundRequestpayment = Upc_payment_xml.RefundRequest('merchant_id', 'terminal_id', 'order_id', 'date', 'total_amount', 'currency', 'description', 'approval_code', 'rrn', 'refund_amount')PreAuthorizationRequestpayment = Upc_payment_xml.PreAuthorizationRequest('merchant_id', 'terminal_id', 'order_id', 'date', 'total_amount', 'currency', 'description', 'card_num', 'exp_year', 'exp_month', 'cv_num', 'status', 'cavv', 'eci', 'cavv_alg')Additional arguments:wallet_idPostAuthorizationRequestpayment = Upc_payment_xml.PostAuthorizationRequest('merchant_id', 'terminal_id', 'order_id', 'date', 'total_amount', 'currency', 'description', 'approval_code', 'rrn', 'postauth_amount')TransactionStateRequestpayment = Upc_payment_xml.TransactionStateRequest('merchant_id', 'terminal_id', 'order_id', 'date', 'total_amount', 'currency')AccountVerificationRequestpayment = Upc_payment_xml.AccountVerificationRequest('merchant_id', 'terminal_id', 'order_id', 'date', 'total_amount', 'currency', 'description', 'card_num', 'exp_year', 'exp_month', 'cv_num')RecurrentRequestpayment = Upc_payment_xml.RecurrentRequest('merchant_id', 'terminal_id', 'order_id', 'date', 'total_amount', 'currency', 'description', 'card_num', 'exp_year', 'exp_month', 'cv_num')SettlementRefundRequestpayment = Upc_payment_xml.SettlementRefundRequest('merchant_id', 'terminal_id', 'order_id', 'date', 'total_amount', 'currency', 'description', 'card_num', 'exp_year', 'exp_month', 'ref3')Additional arguments:approval_code,rrn,eci,posconditioncodeMasterPassAuthorizationRequestpayment = Upc_payment_xml.MasterPassAuthorizationRequest('merchant_id', 'terminal_id', 'order_id', 'date', 'total_amount', 'currency', 'description', 'card_num', 'exp_year', 'exp_month', 'cv_num', 'status', 'cavv', 'eci', 'cavv_alg', 'wallet_id')VisaCheckoutAuthorizationRequestpayment = Upc_payment_xml.VisaCheckoutAuthorizationRequest('merchant_id', 'terminal_id', 'order_id', 'date', 'total_amount', 'currency', 'description', 'callid')VisaCheckoutPCIAuthorizationRequestpayment = Upc_payment_xml.VisaCheckoutPCIAuthorizationRequest('merchant_id', 'terminal_id', 'order_id', 'date', 'total_amount', 'currency', 'description', 'card_num', 'exp_year', 'exp_month', 'cv_num', 'status', 'cavv', 'eci', 'cavv_alg', 'callid')AppleGooglePayAuthorizationRequestpayment = Upc_payment_xml.AppleGooglePayAuthorizationRequest('merchant_id', 'terminal_id', 'order_id', 'date', 'total_amount', 'currency',  'description', 'card_num', 'exp_year', 'exp_month', 'tavv')