cancel
Showing results for 
Search instead for 
Did you mean: 

Digital goods manual actions

Options
silva96
Contributor
Posted on

Hi, I'm trying to sell digital goods with the Smart Payment Buttons, the payments work perfect but I think it's not working as digital goods.

I have the following code

setPaypal () {
const $this = this
// eslint-disable-next-line no-undef
paypal.Buttons({
createOrder: function (data, actions) {
return actions.order.create({
payer: {
name: {
given_name: $this.firstName,
surname: $this.lastName
},
email_address: $this.emailAddress
},
purchase_units: [{
amount: {
value: $this.priceUsd,
currency_code: 'USD',
breakdown: {
item_total: {
value: $this.priceUsd,
currency_code: 'USD'
}
}
},
items: [
{
name: `x ${$this.quantity} ProfeCoins`,
category: 'DIGITAL_GOODS',
quantity: '1',
unit_amount: {
value: $this.priceUsd,
currency_code: 'USD'
}
}
]
}],
application_context: {
shipping_preference: 'NO_SHIPPING'
}
})
},
onApprove: function (data, actions) {
$this.element.classList.add('is-hidden')
document.querySelector('#loading-wrapper').classList.remove('is-hidden')
return actions.order.capture().then(function (details) {
// eslint-disable-next-line no-undef
Turbolinks.visit(`/payments/success?trx_id=${details.id}&quantity=${$this.quantity}`)
})
}
}).render('#paypal-button-container')
// This function displays Smart Payment Buttons on your web page.
}

 

The relevant parts of the code are:

 

shipping_preference: 'NO_SHIPPING'

category: 'DIGITAL_GOODS',

Even though, when I click on this black button:

silva96_0-1616166890059.png

It asks me for postal code, what for? I'm not sending anything, these are digital goods.

silva96_1-1616166991728.png
Then when someone pays I get an email I have to do manual things to get my funds.

silva96_2-1616167139044.png   

 

 then 

 

silva96_3-1616167179941.png 

 

then 

 

 

silva96_4-1616167225629.png

 

I don't want to do this for every order, can't this be automatic?

 

 

 

 

 

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.