Open trendak opened 3 years ago
https://github.com/thephpleague/omnipay-stripe#stripe-payment-intents
You are missing 'paymentMethod'
parameter
With 'paymentMethod' I have this same.
How can i download payment methods?
https://github.com/thephpleague/omnipay-stripe#stripe-payment-intents
$paymentMethod = $_POST['paymentMethodId'];
$response = $gateway->authorize([
'amount' => '10.00',
'currency' => 'USD',
'description' => 'This is a test purchase transaction.',
'paymentMethod' => $paymentMethod,
'returnUrl' => $completePaymentUrl,
'confirm' => true,
])->send();
$_POST['paymentMethodId']
is sent from client side - see for example: https://stripe.com/docs/payments/accept-a-payment-synchronously#web-send-to-server - there it is named payment_method_id
:
...
// Otherwise send paymentMethod.id to your server (see Step 4)
fetch('/pay', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
payment_method_id: result.paymentMethod.id,
})
...
How can I download payment methods in php? I need to download payment methods in backend, This is a micro service, after downloading the payment methods it will be sent to the application. It can be done universally so that after changing the gateway, payment methods will be charged?
@trendak i think you are confusing some concepts here. First you should read Stripe docs regarding overall payment flow and how PaymentIntents works (and what is "Stripe payment method")
It can be done universally so that after changing the gateway, payment methods will be charged?
If you ask if you will be able to reuse "Stripe payment method" in gateway other than Stripe then the answer is no :smiley:
@domis86 I think he misunderstood my questions.
I am doing a micro service based on another one and it must contain the same functionality.
Is it possible to download payment methods in backend?
After selecting the payment method, e.g. a bank, I would like the user to be redirected to his website, and in the case of a card like here: https://stripe.com/docs/payments/accept-a-payment?integration=elements
If you ask if you will be able to reuse "Stripe payment method" in gateway other than Stripe then the answer is no 😃
That's not what I meant, it would be weird. I am asking if omnipay has such a method.
So that I could download payment methods regardless of the gateway. I want to do a stripe now but want the code in backend to be the same for another gateway.
OmniPay has a limited set of functionality as standard - authorise, pay, void, fetch payment details, and a few helpers. That's just about it.
Any driver for a specific payment gateway can extend this with gateway-specific features. Be aware that those gateway features won't be portable across other gateway types.
I only have one question. Does omnipay have a payment method download function?
can you define what you mean by "payment method download" ?
@trendak It sounds like you want to get the payment method "card number and security details" and use it on another payment gateway?
So that I could download payment methods regardless of the gateway. I want to do a stripe now but want the code in backend to be the same for another gateway.
That's fraud. You're not going to be able to download the payment method, you can poll stripe for the type of card used and the last four digits, but no payment gateway is going to give you the whole details of the card used. #
I am doing a micro service.
How can i download payment methods?
I don't know if I understood correctly, but when I do authorization it should redirect to the payment gateway.
When i make:
$response = $gateway->authorize([ 'amount' => '10.00', 'currency' => 'USD', 'description' => 'This is a test purchase transaction.', 'returnUrl' => 'http://test.test/web/gateway-return', 'confirm' => true, ])->send();
Then i have error: The source parameter is required