Templates Plugins Courses

Stripe Marketplace Express Plugin:offsession+ SCA

Hi there,

I am having an issue setting up this plugin (Stripe Marketplace) for an offsession payment with SCA.

I looked at a lot of different ressources but I couldn’t grasp how to setup the plugin.

I would like to initiate payment between a customer and a connected account (on behalf of the connected account) and handle SCA if it happens. I don’t have fees to apply on the transaction.

The customer already has a payment method saved I would like to use multiple times.

What Bubble workflow would you consider ?

I tried to create a payment intent directly but I have an HTTP400 error like this :

Capture1

Here are some screenshots of my workflow:

Capt1

What would you consider the best workflow to use ?

Thank you for your help,

Geoffrey

1 Like

Hi @geoffrey.guilbert,

Thanks for reaching out. Sure! Please use our demo app as a reference, where you can locate and test out the scenario, as well as preview its editor to see how the workflows are set up, and replicate on your side as well if you will.

This is the section you need:

So you can simply preview the workflow for it.

Best,
Alex

1 Like

Hi @alexander,

I would like to do the same workflow as Geoffroy.
I looked at the plugin documentation, Stripe documentation, the demo and the bubble editor of the demo for the different workflow.

I struggle to understand, the Creating an offsession PaymentIntent Workflow of the demo as it’sjust setting up an unique PaymentIntent.

  • do i have to setup a session before that? If yes, do I have to link it to the PaymentIntent that comes after ?
  • in case the PaymentIntent return a status = requires_action, how do I handle the SCA ?

To summerize, I suppose a workflow like this:

  1. Create Session
    • currency = eur
    • price ammout = 1000
    • customer = cus_99
    • mode = payment
    • seller id = acct_11
    • capture method = automatic
    • on behalf of = acct_11
    • setup futur usage = off_session
  2. Create PaymentIntent
    • amount = 1000
    • currency = eur
    • payment method = pm_99
    • customer = cus_99
    • confirm = true
    • off_session = true
    • capture method = automatic

But what do I do in case SCA is triggered ?
Am I on the right track ?

Thank you very much for your help,

I tried a card requiring SCA as saved payment method on the demo, and got an error on using Creating an offsession PaymentIntent:
How to handle this ?

The service Stripe marketplace (testing) - Create a payment intent just returned an error (HTTP 402). Please contact the plugin author directly for feedback. Raw error:

{
  "error": {
    "charge": "ch_1IkV5YAot0xnZIbQ8POSrBx2",
    "code": "authentication_required",
    "decline_code": "authentication_required",
    "doc_url": "https://stripe.com/docs/error-codes/authentication-required",
    "message": "Your card was declined. This transaction requires authentication.",
    "payment_intent": {
      "id": "pi_1IkV5YAot0xnZIbQxDScRbYS",
      "object": "payment_intent",
      "amount": 1000,
      "amount_capturable": 0,
      "amount_received": 0,
      "application": null,
      "application_fee_amount": null,
      "canceled_at": null,
      "cancellation_reason": null,
      "capture_method": "automatic",
      "charges": {
        "object": "list",
        "data": [
          {
            "id": "ch_1IkV5YAot0xnZIbQ8POSrBx2",
            "object": "charge",
            "amount": 1000,
            "amount_captured": 0,
            "amount_refunded": 0,
            "application": null,
            "application_fee": null,
            "application_fee_amount": null,
            "balance_transaction": null,
            "billing_details": {
              "address": {
                "city": null,
                "country": "FR",
                "line1": null,
                "line2": null,
                "postal_code": null,
                "state": null
              },
              "email": "[email protected]",
              "name": "Villa Mars",
              "phone": null
            },
            "calculated_statement_descriptor": "MARKETPLACE LLC",
            "captured": false,
            "created": 1619446024,
            "currency": "usd",
            "customer": "cus_JNFYp3caawIPGh",
            "description": "Description",
            "destination": null,
            "dispute": null,
            "disputed": false,
            "failure_code": "authentication_required",
            "failure_message": "Your card was declined. This transaction requires authentication.",
            "fraud_details": {
            },
            "invoice": null,
            "livemode": false,
            "metadata": {
            },
            "on_behalf_of": null,
            "order": null,
            "outcome": {
              "network_status": "declined_by_network",
              "reason": "authentication_required",
              "risk_level": "normal",
              "risk_score": 53,
              "seller_message": "The bank returned the decline code `authentication_required`.",
              "type": "issuer_declined"
            },
            "paid": false,
            "payment_intent": "pi_1IkV5YAot0xnZIbQxDScRbYS",
            "payment_method": "pm_1IkV4kAot0xnZIbQ04eq8cvs",
            "payment_method_details": {
              "card": {
                "brand": "visa",
                "checks": {
                  "address_line1_check": null,
                  "address_postal_code_check": null,
                  "cvc_check": "pass"
                },
                "country": "DE",
                "exp_month": 5,
                "exp_year": 2022,
                "fingerprint": "Pulnj8L2SlyKC2cb",
                "funding": "credit",
                "installments": null,
                "last4": "3184",
                "network": "visa",
                "three_d_secure": null,
                "wallet": null
              },
              "type": "card"
            },
            "receipt_email": null,
            "receipt_number": null,
            "receipt_url": null,
            "refunded": false,
            "refunds": {
              "object": "list",
              "data": [

              ],
              "has_more": false,
              "total_count": 0,
              "url": "/v1/charges/ch_1IkV5YAot0xnZIbQ8POSrBx2/refunds"
            },
            "review": null,
            "shipping": null,
            "source": null,
            "source_transfer": null,
            "statement_descriptor": null,
            "statement_descriptor_suffix": null,
            "status": "failed",
            "transfer_data": null,
            "transfer_group": null
          }
        ],
        "has_more": false,
        "total_count": 1,
        "url": "/v1/charges?payment_intent=pi_1IkV5YAot0xnZIbQxDScRbYS"
      },
      "client_secret": "pi_1IkV5YAot0xnZIbQxDScRbYS_secret_VKq1ODCc7SwN2M3ft0DXHG2DL",
      "confirmation_method": "automatic",
      "created": 1619446024,
      "currency": "usd",
      "customer": "cus_JNFYp3caawIPGh",
      "description": "Description",
      "invoice": null,
      "last_payment_error": {
        "charge": "ch_1IkV5YAot0xnZIbQ8POSrBx2",
        "code": "authentication_required",
        "decline_code": "authentication_required",
        "doc_url": "https://stripe.com/docs/error-codes/authentication-required",
        "message": "Your card was declined. This transaction requires authentication.",
        "payment_method": {
          "id": "pm_1IkV4kAot0xnZIbQ04eq8cvs",
          "object": "payment_method",
          "billing_details": {
            "address": {
              "city": null,
              "country": "FR",
              "line1": null,
              "line2": null,
              "postal_code": null,
              "state": null
            },
            "email": "[email protected]",
            "name": "Villa Mars",
            "phone": null
          },
          "card": {
            "brand": "visa",
            "checks": {
              "address_line1_check": null,
              "address_postal_code_check": null,
              "cvc_check": "pass"
            },
            "country": "DE",
            "exp_month": 5,
            "exp_year": 2022,
            "fingerprint": "Pulnj8L2SlyKC2cb",
            "funding": "credit",
            "generated_from": null,
            "last4": "3184",
            "networks": {
              "available": [
                "visa"
              ],
              "preferred": null
            },
            "three_d_secure_usage": {
              "supported": true
            },
            "wallet": null
          },
          "created": 1619445974,
          "customer": "cus_JNFYp3caawIPGh",
          "livemode": false,
          "metadata": {
          },
          "type": "card"
        },
        "type": "card_error"
      },
      "livemode": false,
      "metadata": {
      },
      "next_action": null,
      "on_behalf_of": null,
      "payment_method": null,
      "payment_method_options": {
        "card": {
          "installments": null,
          "network": null,
          "request_three_d_secure": "automatic"
        }
      },
      "payment_method_types": [
        "card"
      ],
      "receipt_email": null,
      "review": null,
      "setup_future_usage": null,
      "shipping": null,
      "source": null,
      "statement_descriptor": null,
      "statement_descriptor_suffix": null,
      "status": "requires_payment_method",
      "transfer_data": null,
      "transfer_group": null
    },
    "payment_method": {
      "id": "pm_1IkV4kAot0xnZIbQ04eq8cvs",
      "object": "payment_method",
      "billing_details": {
        "address": {
          "city": null,
          "country": "FR",
          "line1": null,
          &q
1 Like

When using the plugin PaymentIntent, it says No such customer cus_.... The same as Geofrey.

Yet, when using the exact same parameter (cus_, pm_, acct_) directly on Postman I can make a succesful PaymentIntent.
Do you have an idea of what is going on ?

Thanks you for you help @alexander

1 Like

Hi @Terrence,

Thanks for reaching out. Please let us check on it then get back to you asap!

Best,
Alex

2 Likes

Thank you very much Alexander for yout time :pray:,

I wanted to add as much informations as possible and as precisely as possible to help you understand what I would like to do before your reply.

Goal

I would like to make a direct charge between a customer and a connected account, off_session. Next handle the SCA if triggered with a page asking to enter verification code and complete payment.
I do not want money to transit on the platform, and would like to initiate payment between customer and connected account only.

My Stripe account

I’m a platform with onboarded:

:key: API key

I already tested the plugin connected account express creation so my test API key is good and valid.

Pre Test

I first tested what I want to do using the API directly with Python following the Stripe API doc with a single simple PaymentIntents

stripe.PaymentIntent.create(
    amount=1000,
    currency="eur",
    payment_method_types=["card"],
    confirm=True,
    customer="cus_1111111111",
    payment_method="pm_1111111111",
    setup_future_usage="off_session",
    on_behalf_of="acct_999999999",
    transfer_data={"destination": "acct_999999999"},
)

So I would like to do exactly the same thing as this call using the plugin.

Zeroqode Stripe Marketplace Express plugin

I tried to do the same thing Pre test with the plugin’s PaymentIntents. My workflow contains only the PaymentIntents action just like suggested in the demo.
I made no clone, no session before.
off session
My Plugin’s PaymentIntents’ workflow parameters on my bubble:

(header) Stripe-account = acct_999999999

(param) amount = 1000
(param) currency = eur
(param) payment_method = pm_1111111111
(param) customer = cus_1111111111
(param) confirm = true
(param) off_session = true
(param) capture_method = automatic

The only thing that differ from the demo is the addition of the (header) Stripe-account,
Right now all seems good event tough I don’t have all the options just like the API call in Pre test.

Result

Here comes the error exactly the same as @geoffrey.guilbert saying the customer does not exists.
Capture1

:x:Tests

Tested different acct_, diffrent cus_ with different pm_. Still got the same error.

:mag_right: Random search on the internet

It seems the “No such customer” means the customer does not exists on the connected account’s account which is True. But this kind of behaviour seems normal when using older charges and sources. On the contrary newer Stripe PaymentIntents like in my Pre test, handles payment without the need to have the connected account register a client before a payment.

Summary

  • Is the error a problem from me or from the plugin ?
  • Is it possible to do with the plugin, what i want to do ? If yes, would you please guide me ?

I may be too much focus on it and can’t see an obvious solution maybe :man_shrugging:

It seems like it’s similar to what @keishasthomas had.

Thanks again so much for taking time to read me.
Hope this helps.
Hope the best :muscle:

1 Like

Hi @Terrence,

Thanks a lot for the thorough feedback!!

Let me try to help you here.

So, first of all - if you are enquiring an authentication when doing a Payment Intent, then it is possible to create a payment only by creating a session. At least, this is how the plugin works at the moment.

The plugin doesn’t come with a separate authentication for Payment Intent I’m afraid.

Regarding “no such customer”, it is required to firstly Clone a customer’s payment method action and use the resulted token form the Create a payment intent action.

This is only in case you are doing a payment to the seller.

Hope it helps.

Best,
Alex

1 Like

Hi Alex!

Thank you for your help but I still can’t figure out how it works… I did a clone a customer’s payment method as you said as well as a create a payment intent action. Still, this doesn’t work.

No error message is returned.

Here you will find screenshots of my workflow:


I also noticed that the first action (clone a customer’s payment method) returns an empty string for the customer_id.

Thank you very much for your help

Geoffrey

Hi @geoffrey.guilbert,

Thanks for feedback. Please let us check on it then get back to you asap!

Best,
Alex

Hi @geoffrey.guilbert,

The actions setups seem to be correct, but it depends on what data is being passed. The easiest way of testing it is actually passing some static values, for example:

And please take a look into this field specifically:

image

Let me know how it goes.

Best,
Alex

Hi Alex,

Thank you for your reply. I’m very sorry but this still doesn’t work.
I mean, I think I am using the right data but there’s no change…

There’s still two things I don’t quite understand.

  1. What’s the exact difference between a payment method id starting with “card_” and a payment method id starting with “pm_”?

  2. Also, you asked me to take a look at the customer id specifically. How did you get two different IDs for the “clone a customer’s payment method” and the “create a payment intent”.
    I tried using the customer id I get in the result of the clone. But as I said before, it returns an empty field.
    I also tried to use the same customer id in both the “clone” action and the “create a payment intent” action, but I get the following message:

image

I’d just like to re-explain you what I am trying to do here, so we are both sure we’re on the same page.

My app has users who receive “orders” from their customers. These orders need to be paid to suppliers by my users. I would like my users to be able to click on a button “pay this order”, which will trigger a payment to the concerned supplier. I am not taking any fee through this process.
Money only goes from the user to the supplier.
Of course, I want them to be able to click only once in order to pay. I don’t want them to leave the app, a revalidate the payment on Stripe. This needs to be fluid.

Do we agree this is possible with your plugin?

Thanks again for your help.
Looking forward to hearing from you.

Geoffrey

Hi @geoffrey.guilbert,

Thanks for the details! Yes, it is possible to accomplish it. Just a couple of notes.

The Payment method starts with pm, but the card ID stars with card - two different things.

If using the card ID, you need to Link customer to a seller and then Create a charge.

If using the payment methods, you need to Clone a customer’s payment method and then Create a payment intent. The idea is that via payment method it is required to be created one with Stripe Checkout. You insert the card data then create a payment method that can be later on used for payment intents.

In case this is not satisfying your requirements, just use the second option (you don’t need to be redirected to the Checkout). In our demo we have an example when you simply insert card data and pay a seller. Just follow the user flow for this demo button:

Hope it helps.

Best,
Alex