Skip to content

Instantly share code, notes, and snippets.

@gusLopezC
Last active August 11, 2020 22:11
Show Gist options
  • Save gusLopezC/63cf2a9676da39d8a3680722e5fe1fe9 to your computer and use it in GitHub Desktop.
Save gusLopezC/63cf2a9676da39d8a3680722e5fe1fe9 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="somebody@example.com",
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