示例#1
0
def __create_credit_card_transaction():
    customer = Customer(id='cus_bd838e3611d34d598',
                        firstName='John',
                        lastName='Doe',
                        email='*****@*****.**',
                        country='US')

    payment = Payment(paymentOption='CreditCard',
                      holder='John Doe',
                      creditCardNumber='4111111111111111',
                      CVV2='222',
                      creditCardType='visa',
                      expirationYear='2019',
                      expirationMonth='12')

    redirectUrls = RedirectUrls(
        returnUrl='http://2000charge.com/message/success.html',
        cancelUrl='http://2000charge.com/message/failure.html')

    return Transaction.create({
        'customer': customer,
        'payment': payment,
        'amount': 500,
        'currency': 'EUR',
        'iPAddress': '127.0.0.1',
        'redirectUrls': redirectUrls
    })
示例#2
0
def __create_brazil_pay_bank_transfer_transaction():
    customer = Customer(firstName='Jose',
                        lastName='Silva',
                        email='*****@*****.**',
                        address='Rua E',
                        address2='1040',
                        city='Maracanau',
                        zip='61919-230',
                        country='BR',
                        state='CE',
                        birthDate='12/04/1979',
                        phone='+5572222312')

    payment = Payment(paymentOption='BrazilPayBankTransfer',
                      holder='Jose Silva',
                      documentId='853.513.468-93',
                      bankCode='hsbc')

    redirectUrls = RedirectUrls(
        returnUrl='http://2000charge.com/message/success.html',
        cancelUrl='http://2000charge.com/message/failure.html')

    return Transaction.create({
        'customer': customer,
        'payment': payment,
        'amount': 4500,
        'currency': 'EUR',
        'iPAddress': '127.0.0.1',
        'redirectUrls': redirectUrls
    })
示例#3
0
def __create_directpay_transaction():
    customer = Customer(id='cus_bd838e3611d34d598',
                        firstName='John',
                        lastName='Doe',
                        email='*****@*****.**',
                        country='DE')

    payment = Payment(paymentOption='directpay', holder='John Doe')

    redirectUrls = RedirectUrls(
        returnUrl='http://2000charge.com/message/success.html',
        cancelUrl='http://2000charge.com/message/failure.html')

    return Transaction.create({
        'customer': customer,
        'payment': payment,
        'amount': 100,
        'currency': 'EUR',
        'iPAddress': '127.0.0.1',
        'redirectUrls': redirectUrls
    })