#arielbo

1 messages · Page 1 of 1 (latest)

solid skiffBOT
molten sedge
#

Hi there, you mean you want to update the currency of an existing payment intent?

ashen reef
#

I m using php and I have configured with usd but, my dude is if I just change usd to bob or maybe I need to do something more or change any, do you understand me?

molten sedge
#

I don't quite understand.

ashen reef
#

I explain better, I have a flow by which my clients configure their products and services to sell them on my website but I want them to choose the currency in which they want to do it, so I have created a gateway that works very well with USD, and payment intent, But now my doubt is if to modify this I have to change only the currency field from usd to bob (eg to bolivia) or in addition to doing this do I have to change something else?

molten sedge
#

You might also want to change the amount based on the currency conversion.

ashen reef
#

this is my code:
header('Content-Type: application/json');

  try {
      // retrieve JSON from POST body

      $json_str = file_get_contents('php://input');
      $json_obj = json_decode($json_str);
    
      //Create a PaymentIntent cuando carga la page 
        
                $paymentIntent = $stripe->paymentIntents->create([
                    'amount' => $json_obj->s_precio,
                    'currency' => 'bob',
                    'automatic_payment_methods' => [
                        'enabled' => false,
                    ],
                    ]);
                    $output = [
                        'clientSecret' => $paymentIntent->client_secret,
                    ];
molten sedge
ashen reef
#

I just to change this line: 'currency' => 'bob', ?

#

also notice that BOB is not supported by American Express no problem

molten sedge
#

The code looks good to me, did you run into any problem?

ashen reef
ashen reef
molten sedge
#

Sound good, feel free to reach out if you have any questions.

ashen reef
#

thanks a lot, I test now