Я прочитал документы , и я думаю, что вы могли бы сделать это, попробуйте и дайте мне знать, если это сработало
paypal.Buttons({
createOrder: function(data, actions) {
// Set up the transaction
return actions.order.create({
purchase_units: [{
amount: {
value: '{{total_formatted}}',
currency_code: '{{currency_iso}}'
}
}],
shipping: {
method: "United States Postal Service",
address: {
name: {
give_name:"John",
surname:"Doe"
},
address_line_1: "123 Townsend St",
address_line_2: "Floor 6",
admin_area_2: "San Francisco",
admin_area_1: "CA",
postal_code: "94107",
country_code: "US"
}
}
});
},
style: {
size: 'responsive',
color: 'blue',
shape: 'pill',
},
onApprove: function(data, actions) {
// Capture the funds from the transaction
return actions.order.capture().then(function(details) {
// Show a success message to your buyer
window.location.href = 'Some place';
});
}
}).render('#paypal-button-container');