Comments (6)
The response the onPaymentStatus receives is whatever your server API that handled the purchase sends. So, your server should have a response from Braintree, before onPaymentStatus is called which gives you the response where you should find something like response.IsSuccessStatusCode which tells whether the transaction was a success. Its upto your api to decide what and how much details to return to ngx-braintree to make any decisions on the client side. ngx-braintree just receives whatever transaction response is sent by your server which you access via listening to paymentStatus event.
from ngx-braintree.
Amount is not passed to Paypal Checkout.
and my Purchase API is not being called when using Paypal Checkout so I am not getting anything on PaymentStatus()
Is my way of calling Paypal Checkout valid? Here is my code
This Code works perfectly when using braintree Drop-in, getting responce and evething is perfect but not working when using Paypal Checkout (I have linked my paypal sandbox account with braintree so that is not an issue)
<ngx-braintree
[clientTokenURL]="'/dev/get-client-token'"
[createPurchaseURL]="'/dev/purchase-url'"
[chargeAmount]="55.55"
[buttonText]="'Pay'"
(paymentStatus)="onPaymentStatus($event)"
[enablePaypalCheckout] = "true"
[currency]="'USD'">
</ngx-braintree>
I am Using AWS Lambda for API for Node.js
My getClientToken() function
gateway.clientToken.generate({}, function (err, response) {
var clientToken = response.clientToken;
const res = {
"headers": {
'access-control-allow-origin': '*'
},
"statusCode": 200,
"body": JSON.stringify({
"token": clientToken
})
};
callback(null, res);
});
My purchaseURL() function
gateway.transaction.sale({
amount: data.amount,
paymentMethodNonce: data.nonce,
options: {
submitForSettlement: true
}
},
function (err, result) {
console.log('After Trancection');
console.log(result);
const res = {
"headers": {
'access-control-allow-origin': '*'
},
"statusCode": 200,
"body": JSON.stringify({result})
};
callback(null, res);
});
from ngx-braintree.
As in documentation, ngx-braintree posts the nonce and the chargeAmount, to the URL you provide, in the following format:
{"nonce":"d7438dd5-7f14-0b2a-7a6f-f3c83d43b5b7","chargeAmount":55.55}
I see that your purchaseURL() function is trying to read the amount as data.amount shouldn't it be data.chargeAmount?
from ngx-braintree.
my mistake on that.
I mistakenly wrote it wrong here, that is correct on my server, that is not an issue as when I pay with drop-in it works, the API is not being called when I pay with Paypal checkout and also the amount of payment is also not displayed on paypal checkout.
As you can see the amount is not being passed to paypal checkout
from ngx-braintree.
Well, ngx-braintree has no control on this window. Although it could configure this window to some extent for example, to show shipping address (which it currently is not doing yet), but AFAIK the amount is not displayed for paypal express checkout (the amount might get displayed for other types of paypal integrations but not for Paypal in Braintree DropIn UI). The visit to PayPal window is only to login and its back to your application after logging in where you can (or already are) displaying the amount to charge anyway.
from ngx-braintree.
@CodeAnomalies how do you fixed this issue
from ngx-braintree.
Related Issues (20)
- Angular 7 support HOT 4
- How to remove the place holder (......) present in cardName braintree dropin ui.
- VaultManager support - to delete a saved payment method HOT 3
- I am getting CORs error HOT 1
- Customer does not have any credit cards
- Also, how do you get the nonce and chargeAmount when you implement your own method? Your example shows an HTTP get, when the code shows a post to the url. HOT 1
- How to correctly handle (paymentStatus)="onPaymentStatus($event)" for Ionic 3 HOT 1
- [allowChoose] = "true" not working
- How to edit/delete saved card. HOT 2
- PayPay Checkout Issue HOT 1
- Support for Angular 8 applications HOT 9
- I have used checkbox below the ngx-braintree , its accept terms and conditions check box, i have to know all card details are Filled or not,
- SCA Requirements of 3D Secure 2.0
- "No payment method is available" HOT 3
- Add support for local payment methods
- Sending additional information with checkout HOT 1
- angular 9 support
- Http Client Injection Not Working
- How to implement payPal Credit option
- how to install for angular version 15 onwards because it only appears for angular version 8 and below?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ngx-braintree.