如何获得shopee api授权使用php5.3 [英] how to get shopee api Authorization use php5.3

查看:97
本文介绍了如何获得shopee api授权使用php5.3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用源代码获得 shopee授权.我使用的语言是php.5.3.2.无论我搜索多少次,我都只有一个有关较高版本的演示,因此找不到想要的答案.

i want to get shopee authorization using the source code. The language I use is php.5.3.2. No matter how many times I search, I only have a demo about the higher version, so I can't find the answer I want to ask.

在shopee中,您可以将默认签名序列和伙伴密钥值计算为"HMAC-SHA256",并创建一个授权值.如何用代码编写?

In shopee, you can calculate the default signature sequence and partner key value as "HMAC-SHA256" and create an autorization value. How can I write it in code?

我已经获得了合作伙伴密钥..但是我不知道如何获得授权.

i already get partner key.. but i don't know how to get authorization.

推荐答案

如果可以在php应用程序中使用npm包,则可以使用以下代码:

If you can use npm package in your php app, you can use this code:

import { createHmac } from 'crypto';
    
const timestamp = getUTCUnixTimestamps();
const baseString = `${AppID}${Apipath}${timestamp}`;
const signCode = createHmac('sha256',shopeeAppSecret).update(baseString).digest('hex');

这篇关于如何获得shopee api授权使用php5.3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆