Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

amount is not changing from 0.01 #188

Open
JunaidVenrup opened this issue Aug 24, 2021 · 2 comments
Open

amount is not changing from 0.01 #188

JunaidVenrup opened this issue Aug 24, 2021 · 2 comments

Comments

@JunaidVenrup
Copy link

JunaidVenrup commented Aug 24, 2021

this.payPalConfig = {
currency: this.currency,
clientId: environment.paypal,
createOrder: (data) =>
{
intent: 'CAPTURE',
purchase_units: [
{
amount: {
currency_code: this.currency,
value: this.price,
breakdown: {
item_total: {
currency_code: this.currency,
value: this.price,
},
},
},
items: [
{
name: this.vendor,
quantity: this.quantity,
category: this.productName,
unit_amount: {
currency_code: this.currency,
value: this.price,
},
},
],
},
],
},
advanced: {
commit: 'true',
},
style: {
label: 'paypal',
layout: 'horizontal',
color: 'black',
tagline: '',
},
onApprove: (data, actions) => {
console.log(
'onApprove - transaction was approved, but not authorized',
data,
actions
);
actions.order.get().then((details) => {
console.log(
'onApprove - you can get full order details inside onApprove: ',
details
);
});
},
onClientAuthorization: (data) => {
console.log(
'onClientAuthorization - you should probably inform your server about completed transaction at this point',
data
);
this.paymentDone.emit(true);
},

  onCancel: (data, actions) => {
    console.log('OnCancel', data, actions);
  },
  onError: (err) => {
    console.log('OnError', err);
    this.toast.error('Please try again later!', 'Something Went Wrong');
  },
  onClick: (data, actions) => {
    console.log('onClick', data, actions);
  },
};

}

amount always stays same to 0.01 on checkout no matter whatever I do, I've tried putting static values but all in vain, I am using latest version 8.0.0

@rubengg86
Copy link

I was struggling with this a lot, instead use createOrder use createOrderOnClient. Cheers

@saranglakare
Copy link

See this solution : #242 (comment)

If works if you are ok creating subscriptions on client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants