微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

后端响应成功后打开贝宝结帐模式

如何解决后端响应成功后打开贝宝结帐模式

如果用户在他的表单上输入他的详细信息并提交表单,我有一个表单,提交表单后它存储到数据库中,并且在成功将用户数据存储在数据库中后,我必须打开贝宝结帐模式,否则不会。

这是支付宝

paypal.Button.render({

  env: 'sandBox',client: {
    sandBox: ''
    // production: 'demo_production_client_id'
  },locale: 'en_US',style: {

    layout: 'horizontal',size: 'small',color:  'blue',shape:  'pill',label: 'checkout',height: 40,tagline: 'false'
  },commit: true,payment: (data,actions) => { 
      return actions.payment.create({
        transactions: [{
          amount: {
            total: '1',currency: 'USD'
          }
        }]
      });
  },onAuthorize: function(data,actions) {
    return actions.payment.execute()
    .then(function() {  
      window.alert('Thank you for your purchase!');
    });
  }
 },this.paypalRef.nativeElement);

这是提交表单api调用

  submit(){
  const data={
   url: this.URL,email:this.email
 }
 this.home.websiteScratching(data)
 .subscribe(res=>{

 },err=>{
   console.log(err);
 })
}


after submit success response i want to go for paypal checkout process how to do it.. i am stuck.

解决方法

简而言之,您必须创建新组件并使用 dialogRef。 https://material.angular.io/components/dialog/overview

 const dialogRef = this.dialog.open(SuccessPaymentPaypalComponent,{
    disableClose: true,data: { PaypaplRetunrnTrasactionId: this.params.Paypalid }
 })
 dialogRef.afterClosed().subscribe(() => {
 });

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。