Skip to content
This repository has been archived by the owner on Mar 20, 2023. It is now read-only.

new a little help here #7

Open
solomoreal opened this issue Aug 24, 2019 · 1 comment
Open

new a little help here #7

solomoreal opened this issue Aug 24, 2019 · 1 comment

Comments

@solomoreal
Copy link

how do I generate the auth_token for a customer before using it to create a subscription, what step should i first take before i use the newSubscription->create(...,...) method

@ultrasamad
Copy link

ultrasamad commented Jan 19, 2021

A little late. If you setup webhooks and you are using the client JavaScript popup option for payment, anytime there's a new subscription from the frontend the auth token is always available in the new subscription webhook event data. So you can pick it up from there and create your subscription without charging since it's already charged by paystack.

This is a sample from the event data:

...
"authorization": {
    "authorization_code": "AUTH_isdzt7wx1h",
     "bin": "408408",
     "last4": "4081",
     "exp_month": "12",
     "exp_year": "2020",
     "channel": "card",
     "card_type": "visa ",
     "bank": "TEST BANK",
     "country_code": "GH",
     "brand": "visa",
     "reusable": true,
     "signature": "SIG_JuApWkGTvBz2AgztRLO9",
     "account_name": null
}

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

No branches or pull requests

2 participants