#birendar-singh_api

1 messages ¡ Page 1 of 1 (latest)

stoic moatBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1276045841299410947

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

amber gull
#

hello! you should be using either Checkout, Elements, or our mobile SDKs to collect payment information and transmit it directly to our servers. We strongly recommend that all users integrate with these methods. https://docs.stripe.com/payments/online-payments

Learn about Stripe's integration choices for accepting online payments.

broken prawn
#

Can I handle recurring payments on my server later using this method?

#

I mean using stripe charge Id.

amber gull
#

If you have already saved the payment method, you will have a PaymentMethod id. You can use that PaymentMethod id to make an off-session payment at a later point in time.

If you're talking specifically about Subscriptions, this is the guide you'll want to refer to : https://docs.stripe.com/billing/subscriptions/build-subscriptions

Learn how to save payment details and charge your customers later.

Learn how to save payment details during a payment.

Create and manage subscriptions to accept recurring payments.

broken prawn
#

Okay, let me review the document above and get back to you.

#

It seems like there are significant changes on our application end.

#

Currently, we are following the steps below:

Step 1: Generating a Token

\Stripe\Stripe::setApiKey($StripeSecretKey);
$token = \Stripe\Token::create(
array(
"card" => array(
"number" => Yii::$app->Inline->validcardnumber($cardetail['cardnumber']),
"exp_month" => $cardetail['exp_month'],
"exp_year" => $cardetail['exp_year'],
"cvc" => $cardetail['cvc'],
"address_zip" => isset($cardetail['zipcode']) ? $cardetail['zipcode'] : "",
)
)
);

Step 2: Creating a Customer:

$productName = isset($customerDetail['product_name']) ? $customerDetail['product_name'] : 'NetizensBank';
\Stripe\Stripe::setApiKey($StripeSecretKey);
$customer = \Stripe\Customer::create(array(
"source" => $customerDetail['token'],
"email" => $customerDetail['stripeEmail'],
"description" => $productName,
));

Step 3: Charging the Payment

$charge = \Stripe\Charge::create(array(
"amount" => $amount, // Amount in cents
"currency" => isset($paymentInfo['currency_code']) ? $paymentInfo['currency_code'] : 'usd',
"customer" => $paymentInfo['stripe_customer_id'],
"description" => isset($paymentInfo['product_name']) ? $paymentInfo['product_name'] : 'NetizensBank',
"statement_descriptor" => $productname2
));

For recurring payments, we are using the Stripe customer ID:

/*

  • For a new Stripe charge
    */
    $charge = \Stripe\Charge::create(array(
    "amount" => $amount, // Amount in cents
    "currency" => isset($paymentInfo['currency_code']) ? $paymentInfo['currency_code'] : 'usd',
    "customer" => $clientCustomerId->stripe_customer_id,
    "description" => "Netizensbank Invoice",
    "statement_descriptor" => "Netizensbank Invoice",
    ));

Due to recent changes in Stripe, we are unable to generate tokens. Additionally, we have many users who have their own Stripe accounts.

#

I appreciate it if you could provide a quick solution to resolve this.

amber gull
broken prawn
#

Account ID: acct_1N64u4SJ1CZHGWkH

#

It was working fine before.

#

Based on my understanding of the issue, we need to enable 'raw card data,' but this requires a lot of details, and many of our clients are unable to enable it. Therefore, I am looking for a solution on our code end.

amber gull
#

you mentioned that this is due to recent changes in Stripe, but from that account id, i don't see any live charges that use raw card data

#

are you using a different account for the charges that you say support raw card data?

broken prawn
#

This is our test account. you can check it under logs

#

Please check in Test mode

amber gull
#

to be clear, you must be provide those information listed in the support site article in order to support raw card data. There's no way around this

broken prawn
#

Okay

#

If I use Stripe.js to generate the token, will it work?

amber gull
#

if what you mean is you're using Checkout, or Elements to generate the payment method (a.k.a token), yes, it will work. As long as you're not handling raw card data on your own

broken prawn
#

Okay, could you please provide the documentation link? I'll test it quickly.

amber gull