当前位置: 首页>>代码示例>>PHP>>正文


PHP Braintree_TransparentRedirect::updateCustomerData方法代码示例

本文整理汇总了PHP中Braintree_TransparentRedirect::updateCustomerData方法的典型用法代码示例。如果您正苦于以下问题:PHP Braintree_TransparentRedirect::updateCustomerData方法的具体用法?PHP Braintree_TransparentRedirect::updateCustomerData怎么用?PHP Braintree_TransparentRedirect::updateCustomerData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Braintree_TransparentRedirect的用法示例。


在下文中一共展示了Braintree_TransparentRedirect::updateCustomerData方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testUpdateCustomerFromTransparentRedirect

 function testUpdateCustomerFromTransparentRedirect()
 {
     $customer = Braintree_Customer::create(array('firstName' => 'Mike', 'lastName' => 'Jonez'))->customer;
     $params = array('customer' => array('first_name' => 'Second'));
     $trParams = array('customerId' => $customer->id, 'customer' => array('lastName' => 'Penultimate'));
     $trData = Braintree_TransparentRedirect::updateCustomerData(array_merge($trParams, array("redirectUrl" => "http://www.example.com")));
     $queryString = Braintree_TestHelper::submitTrRequest(Braintree_TransparentRedirect::url(), $params, $trData);
     $result = Braintree_TransparentRedirect::confirm($queryString);
     $this->assertTrue($result->success);
     $customer = $result->customer;
     $this->assertequals('Second', $customer->firstName);
     $this->assertequals('Penultimate', $customer->lastName);
 }
开发者ID:kingsolmn,项目名称:CakePHP-Braintree-Plugin,代码行数:13,代码来源:TransparentRedirectTest.php

示例2: updateCustomerViaTr

 function updateCustomerViaTr($regularParams, $trParams)
 {
     Braintree_TestHelper::suppressDeprecationWarnings();
     $trData = Braintree_TransparentRedirect::updateCustomerData(array_merge($trParams, array("redirectUrl" => "http://www.example.com")));
     return Braintree_TestHelper::submitTrRequest(Braintree_Customer::updateCustomerUrl(), $regularParams, $trData);
 }
开发者ID:beevo,项目名称:disruptivestrong,代码行数:6,代码来源:CustomerTest.php

示例3: register_auto_payment_action

    function register_auto_payment_action($pack_id, $override_price = false, $return = true)
    {
        $this->_braintree();
        global $current_user;
        get_currentuserinfo();
        if ($current_user->ID) {
            $user_id = $current_user->ID;
        } else {
            $current_user = get_user_by('login', ym_request('username'));
            if ($current_user->ID) {
                $user_id = $current_user->ID;
            } else {
                echo 'bugger';
                return;
            }
        }
        $customer_id = get_user_meta($user_id, 'ym_braintree_customer_id', true);
        if ($customer_id) {
            // validate the customer is still in braintree
            try {
                $customer = Braintree_Customer::find($customer_id);
            } catch (Exception $e) {
                $customer_id = false;
            }
        }
        if (!$customer_id) {
            // create required
            // shunt the customer into braintree
            $result = Braintree_Customer::create(array('id' => 'ym_' . $current_user->ID, 'email' => $current_user->user_email));
            if ($result->success) {
                $customer_id = $result->customer->id;
                update_user_meta($user_id, 'ym_braintree_customer_id', $customer_id);
            } else {
                echo 'bugger';
                return;
            }
        }
        $code = 'buy_subscription_' . $pack_id . '_' . $user_id;
        // credit card form driver
        $trData = Braintree_TransparentRedirect::updateCustomerData(array('redirectUrl' => site_url('?ym_process=' . $this->code . '&action=process&code=' . $code), 'customerId' => $customer_id));
        $key = 'customer';
        $html = '
<form action="' . Braintree_TransparentRedirect::url() . '" method="post" id="' . $this->code . '_cc_form_pack_' . $pack_id . '" class="' . $this->code . '_cc_form" autocomplete="off">
	<input type="hidden" name="tr_data" value="' . htmlentities($trData) . '" />
	<input type="hidden" name="code" value="' . $code . '" />
	<div>
		<label for="braintree_credit_card_number">' . __('Credit Card Number', 'ym') . '</label>
		<input type="text" name="' . $key . '[credit_card][number]" id="braintree_credit_card_number" value=""></input>

		<label for="braintree_credit_card_ccv">' . __('Credit Card CCV', 'ym') . '</label>
		<input type="text" name="' . $key . '[credit_card][cvv]" id="braintree_credit_card_ccv" value=""></input>

		<label for="braintree_credit_card_exp">' . __('Credit Card Expiry (mm/yyyy)', 'ym') . '</label>
		<input type="text" size="7" maxlength="7" name="' . $key . '[credit_card][expiration_date]" id="braintree_credit_card_exp" value=""></input>
	</div>
	<input class="submit-button" type="submit" />
</form>
';
        if ($return) {
            return $html;
        } else {
            echo $html;
            return;
        }
    }
开发者ID:AdultStack,项目名称:ap-members,代码行数:65,代码来源:ym_braintree.php


注:本文中的Braintree_TransparentRedirect::updateCustomerData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。