Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

卡券的 attachExtension 方法 #56

Closed
hubs opened this issue Jul 13, 2015 · 1 comment
Closed

卡券的 attachExtension 方法 #56

hubs opened this issue Jul 13, 2015 · 1 comment

Comments

@hubs
Copy link

hubs commented Jul 13, 2015

    public function attachExtension($cardId, array $extension = array())
    {
        $timestamp = time();

        $ext = array(
            'code'      => Arr::get($extension, 'code',''),
            'openid'    => Arr::get($extension, 'openid', Arr::get($extension, 'open_id','')),
            'timestamp' => $timestamp,
            'outer_id'  => Arr::get($extension, 'outer_id',''),
        );

        $ext['signature'] = $this->getSignature(
            $this->getTicket(),
            $timestamp,
            $cardId,
            $ext['code'],
            $ext['openid']
        );

        return array(
            "cardId"  => $cardId,
            "cardExt" => JSON::encode($ext),
        );
    }

之前返回的是 card_id,card_ext 界面显示不出卡券信息,改成cardId,cardExt就可以了

@overtrue
Copy link
Collaborator

OK,多谢!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants