#xqprtzcv

1 messages · Page 1 of 1 (latest)

mighty forgeBOT
left basalt
#

When I manually clicked the try charge again button in the dashboard it worked. But still not sure why it doesn't charge automatically.

past glacier
#

You need to specify a default_payment_method -- either on the Subscription, or on the Customer's invoice_settings

#

Without that, the recurring invoice does not have a payment method to use

#

When manually retrying in the dashboard you're specifying the payment method to use

left basalt
#

Ok, I am creating a subscription with "payment_behavior":"default_incomplete", and then I am using the payment element to collect the payment. Can I make the last used payment method the default payment method with that flow?

past glacier
left basalt
#

Perfect

#

Thank you

past glacier
#

NP!

left basalt
#

Also, on an unrelated note. When I try to display the google pay button using StripeJS, I get an error in the console: "Unable to download payment manifest "https://pay.google.com/about/"." Then when I try to click the button, a window opens, but it just hangs and displays as blank grey. Not sure if I need to add my domain somewhere on google's site.

past glacier
#

Can you share some specifics about how you've integrated that?

mighty forgeBOT
left basalt
#

Sure, this is what my JS looks like:

#

const paymentRequest = stripe.api.paymentRequest({
"country": 'US',
"currency": 'usd',
"total": {
"label": 'Demo total',
"amount": 1099,
},
"requestPayerName": true,
"requestPayerEmail": true,
"requestShipping": true,
"shippingOptions":[
{
"id": 'free',
"label": 'Free shipping',
"detail": 'Ground shipping via UPS or FedEx',
"amount": 0,
},
{
"id": 'expedited',
"label": 'Expedited shipping',
"detail": 'Priority printing and shipping',
"amount": 500,
}
]
});

    let buttonElement = e["obj"].create('paymentRequestButton',{
        "paymentRequest":paymentRequest,
      "style": {
        "paymentRequestButton": {
          "type": "default",// One of 'default', 'book', 'buy', or 'donate'
          "theme": "dark",// One of 'dark', 'light', or 'light-outline'
          "height": 8*vh+"px",// Defaults to '40px'. The width is always '100%'.
        },
      }
    });
#

And then this:

#

(async () => {
// Check the availability of the Payment Request API first.
const result = await paymentRequest.canMakePayment();
if (result) {
buttonElement.mount(requestButton);
}
})();

#

I am also getting this error in the console, which may or may not be related: Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://js.stripe.com') does not match the recipient window's origin ('https://local.example.com:4443').

past glacier
#

Are you sure your button is created and mounted correctly? Your code doing something a bit different than we document

#

eg:

#

let buttonElement = e["obj"].create('paymentRequestButton',{ ...
is e the stripe elements instance here?

#

then later:
buttonElement.mount(requestButton);
Are both of these variable containing the value expected?

left basalt
#

const elementsOptions = {"clientSecret":args["secret"],"appearance":stripe.appearance()};
const elements = stripe.api.elements(elementsOptions);
e["obj"]=elements;

#

so e["obj"] is the elements instance

#

I believe both look correct, and the button is showing up correctly

lone island
#

Hello 👋
It could be an issue with local server configuration OR something.
Have you tried hosting this code somewhere?

left basalt
#

I just tried to push it to one of the dev domains, and was still seeing the same problem (unable to load manifest, and when I load manifest in another tab, it works)