Skip to content

Instantly share code, notes, and snippets.

@yasmanycastillo
Forked from gusLopezC/OpenPay_Paynet_Python
Created August 11, 2020 22:11
Show Gist options
  • Save yasmanycastillo/6a57fb4c9bbc514c2150a086aafb46ff to your computer and use it in GitHub Desktop.
Save yasmanycastillo/6a57fb4c9bbc514c2150a086aafb46ff to your computer and use it in GitHub Desktop.
# -*- coding: utf-8 -*-
import sys
import datetime
from os import path, pardir
PROJECT_ROOT = path.dirname(path.abspath(__file__))
sys.path.append(path.join(PROJECT_ROOT, pardir))
import openpay
openpay.api_key = "sk_c71babd865fd420b94bc588a8585c122"
openpay.verify_ssl_certs = False
openpay.merchant_id = "mdrhnprmsmxkgxtegzhk"
#customer = openpay.Customer.retrieve('am7aypxgzqqspucaag78')
customer = openpay.Customer.create(
name="Juan",
email="[email protected]",
address={
"city": "Queretaro",
"state":"Queretaro",
"line1":"Calle de las penas no 10",
"postal_code":"76000",
"line2":"col. san pablo",
"line3":"entre la calle de la alegria y la calle del llanto",
"country_code":"MX"
},
last_name="Perez",
phone_number="44209087654"
)
print(customer);
print("Creating charge as merchant")
charge = customer.charges.create(
method="store",
amount=100,
description="Fourth charge")
print("charge: ", charge)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment