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

Capture Payment Later #47

Closed
chintan-dhandhusariya opened this issue Jul 19, 2018 · 1 comment
Closed

Capture Payment Later #47

chintan-dhandhusariya opened this issue Jul 19, 2018 · 1 comment

Comments

@chintan-dhandhusariya
Copy link

I want to only authorize my payment first and payment-capture will be done later. But, upon trying with my current code, the sandbox account that I use, displays all the transactions as 'completed'. What do I do to only 'authorize' my payment and not capture it? This is my code:

render() {
    const {
        total,
        currency,
        env,
        commit,
        client,
        onSuccess,
        onError,
        onCancel,
      } = this.props;
  
      const {
        showButton,
      } = this.state;
  
      const payment = () =>
      paypal.rest.payment.create(env, client, {
        transactions: [
          {
            amount: {
              total,
              currency,
            }
          },
        ],
      });
const onAuthorize = (data, actions) =>{
      actions.payment.execute()
          .then(() => {
            onSuccess(data,actions);
        });
      }
  
      return (
        <div>
          {showButton && <paypal.Button.react
            env={env}
            client={client}
            commit={commit}
            payment={payment}
            onAuthorize={onAuthorize}
            onCancel={onCancel}
            onError={onError}
          />}
        </div>
      );
    }
@rwieruch
Copy link
Owner

rwieruch commented Jan 4, 2019

Since this got inactive and no one was able to help, I will close it for now.

@rwieruch rwieruch closed this as completed Jan 4, 2019
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

2 participants