How can I set this:
private static function buildRequestBody()
{
return array(
'intent' => 'AUTHORIZE',
'purchase_units' =>
array(
0 =>
array(
'amount' =>
array(
'currency_code' => 'USD',
'value' => '220.00'
)
),
array(
'payee' =>
array(
'email_address' => 'payee@email.com'
)
)
)
);
}
As an object within the purchase_units array in this:
<div id="paypal-button-container"></div> <script src="https://www.paypal.com/sdk/js?client-id=sb¤cy=USD" data-sdk-integration-source="button-factory"></script>
<script>
paypal.Buttons({
style: {
shape: 'pill',
color: 'gold',
layout: 'vertical',
label: 'pay',
},
createOrder: function(data, actions) {
return actions.order.create({
purchase_units: [{
amount: {
value: '1'
}
}]
});
},
onApprove: function(data, actions) {
return actions.order.capture().then(function(details) {
alert('Transaction completed by ' + details.payer.name.given_name + '!');
});
} }).render('#paypal-button-container'); </script>
I want to be able to send money to other people directly through this button, instead of using it on a website to pay the owner if that makes sense. Thanks