|
@@ -2,6 +2,7 @@
|
|
|
namespace app\service\byte_dance;
|
|
|
|
|
|
use think\Cache;
|
|
|
+use think\Collection;
|
|
|
|
|
|
class ByteDancePay implements ByteDanceInterface {
|
|
|
protected $data=[
|
|
@@ -40,7 +41,12 @@ class ByteDancePay implements ByteDanceInterface {
|
|
|
{
|
|
|
$data=$this->data;
|
|
|
$data['sign']=$this->sign($data);
|
|
|
- return ByteDance::httpPost('https://developer.toutiao.com/api/apps/ecpay/v1/create_order',$data);
|
|
|
+ $order=ByteDance::httpPost('https://developer.toutiao.com/api/apps/ecpay/v1/create_order',$data);
|
|
|
+ $obj=new ByteDanceResult();
|
|
|
+ foreach ($order as $key=>$item){
|
|
|
+ $obj->offsetSet($key,$item);
|
|
|
+ }
|
|
|
+ return $obj;
|
|
|
}
|
|
|
|
|
|
protected function sign($map) {
|
|
@@ -61,4 +67,10 @@ class ByteDancePay implements ByteDanceInterface {
|
|
|
sort($rList, 2);
|
|
|
return md5(implode('&', $rList));
|
|
|
}
|
|
|
-}
|
|
|
+}
|
|
|
+/**
|
|
|
+ * @property string $order_id
|
|
|
+ * @property string $order_token
|
|
|
+ * @property string $url
|
|
|
+ */
|
|
|
+class ByteDanceResult extends Collection {}
|