コード例 #1
0
def make_gco_request(rd):

    merch_info = get_merchant_info()

    controller = Controller(str(merch_info.merchant_id), str(merch_info.merchant_key), is_sandbox=merch_info.sandbox)

    shopping_cart = gmodel.shopping_cart_t(
        items=[
            gmodel.item_t(
                merchant_item_id=rd.transaction_id,
                name=rd.event_name,
                description=rd.description,
                unit_price=gmodel.price_t(value=rd.price, currency="USD"),
                quantity=1,
            )
        ]
    )

    checkout_flow_support = gmodel.checkout_flow_support_t(
        continue_shopping_url=get_site_url(), request_buyer_phone_number=False
    )

    order = gmodel.checkout_shopping_cart_t(shopping_cart=shopping_cart, checkout_flow_support=checkout_flow_support)

    prepared = controller.prepare_order(order)

    logging.info(prepared.html)

    return prepared.html
コード例 #2
0
ファイル: registration.py プロジェクト: avoinea/stiamro
 def __init__(self, registration):
     self.message = EMAIL_TEMPLATE % {
         'to': registration.email,
         'from': self.addr_from,
         'link': self.confirmation_url % (get_site_url(), registration.hash)}