stripe/stripe-php

Attach a PaymentMethod to a Customer issue

ManoMahe opened this issue · 0 comments

Describe the bug

Am trying to attach a payment method to a customer with the

\Stripe\PaymentMethod::attach(
    'pm_xxx_stripe_paymethod_id', 
    ['customer' => 'cus_xxx_customer_id']
);

but after trying this approach got an issue with $this->instanceUrl() method, which is not available in the PaymentMethod class

I've checked with the latest packages as well the same issues are I can able to see, the following function is missing

function instanceUrl(){
    // here need to do the instance url stuff
    return $url;
}

To Reproduce

Test this code with any valid test payment method and customer ID

\Stripe\PaymentMethod::attach(
    'pm_xxx_stripe_paymethod_id', 
    ['customer' => 'cus_xxx_customer_id']
);

Expected behavior

After adding the required functions of $this->instanceUrl(), it needs to attach the payment method to the particular customer with a success response.

Code snippets

No response

OS

Windows 10

PHP version

PHP 5.4

Library version

stripe-php v6.43.1

API version

2019-08-29

Additional context

No response