Merge pull request #2 from tudinhtu98/ft-more-payment-methods
Ft more payment methods
This commit is contained in:
commit
a3cc64159f
|
@ -28,7 +28,8 @@ export default Component.extend({
|
|||
total: {
|
||||
label: plan.subscriptionRate,
|
||||
amount: plan.unit_amount,
|
||||
}
|
||||
},
|
||||
disableWallets: ["link", "browserCard"],
|
||||
});
|
||||
this.set("buttonElement",
|
||||
elements.create('paymentRequestButton', {
|
||||
|
@ -78,28 +79,28 @@ export default Component.extend({
|
|||
if (authenticationResult && !authenticationResult.error) {
|
||||
return Transaction.finalize(transactionId, planId).then(
|
||||
() => {
|
||||
this.advanceSuccessfulTransaction(plan);
|
||||
this._advanceSuccessfulTransaction(plan);
|
||||
e.complete("success");
|
||||
console.log(`Success: ${authenticationResult.paymentIntent.id}`);
|
||||
}
|
||||
);
|
||||
} else if (authenticationResult.error) {
|
||||
console.log("Payment fail");
|
||||
console.log("Payment fail", authenticationResult.error);
|
||||
e.complete("fail");
|
||||
}
|
||||
}
|
||||
);
|
||||
} else {
|
||||
this.advanceSuccessfulTransaction(plan);
|
||||
this._advanceSuccessfulTransaction(plan);
|
||||
e.complete("success");
|
||||
console.log(`Success`);
|
||||
}
|
||||
})
|
||||
.catch((result) => {
|
||||
e.complete("fail");
|
||||
console.log("Payment fail");
|
||||
console.log("Catch Payment fail");
|
||||
this.dialog.alert(
|
||||
result.jqXHR.responseJSON?.errors[0] || result.errorThrown
|
||||
result.jqXHR?.responseJSON?.errors[0] || result.errorThrown
|
||||
);
|
||||
});
|
||||
|
||||
|
|
|
@ -83,15 +83,6 @@ export default Controller.extend({
|
|||
},
|
||||
|
||||
actions: {
|
||||
alert(path) {
|
||||
this.alert(path)
|
||||
},
|
||||
handleAuthentication(plan, transaction) {
|
||||
this.handleAuthentication(plan, transaction)
|
||||
},
|
||||
advanceSuccessfulTransaction(plan) {
|
||||
this._advanceSuccessfulTransaction(plan)
|
||||
},
|
||||
stripePaymentHandler() {
|
||||
this.set("loading", true);
|
||||
const plan = this.get("model.plans")
|
||||
|
|
|
@ -46,13 +46,13 @@
|
|||
}}
|
||||
|
||||
{{subscribe-google-pay
|
||||
alert=alert
|
||||
stripe=stripe
|
||||
plans=model.plans
|
||||
selectedPlan=selectedPlan
|
||||
promoCode=promoCode
|
||||
advanceSuccessfulTransaction=(action "advanceSuccessfulTransaction")
|
||||
handleAuthentication=(action "handleAuthentication")
|
||||
alert=alert
|
||||
_advanceSuccessfulTransaction=_advanceSuccessfulTransaction
|
||||
handleAuthentication=handleAuthentication
|
||||
}}
|
||||
|
||||
{{/if}}
|
||||
|
|
Loading…
Reference in New Issue