我已将 Paypal 智能按钮集成到我的页面中并且可以正常工作。3天前 Do not pass Pay-xxx 直接给出了错误并告诉我改为发送令牌。这次,当我引用它时,它给出了一个错误:期望传递一个订单 ID。我应该怎么办?
以下代码引发错误:期望传递订单 ID
var CREATE_PAYMENT_URL = '/api/create-payment';
var checkBox = document.getElementById("ship_to_different");
var note = $("#ordernote").val();
if (checkBox.checked == true) {
var body = $("#checkoutt, #data").serializeArray();
} else {
$('input[name=note]').val(note);
var body = $("#data").serializeArray();
}
$("#wait").show();
return fetch(CREATE_PAYMENT_URL, {
method: 'post',
headers: {
'content-type': 'application/json'
},
body: JSON.stringify({
body: body
})
}).then(function (res) {
return res.json();
}).then(function (data) {
console.log(data);
let token;
for (let link of data.links) {
if (link.rel === 'approval_url') { …Run Code Online (Sandbox Code Playgroud) 我有两个数组。
$a = ['0' => 1, '1' => 2, '2' => 3]
$b = ['0' => 4, '1' => 5, '2' => 6]
Run Code Online (Sandbox Code Playgroud)
我想像这样创建新的数组
$c = [['a' => 1, 'b' => '4'], ['a' => '2', 'b' => '5']]
Run Code Online (Sandbox Code Playgroud)
我已经尝试了这些功能array_merge,array_merge_recursive但没有得到积极的结果
$data = array_merge_recursive(array_values($urls), array_values($id));
Run Code Online (Sandbox Code Playgroud)